📪Creating a Database

Accessing the Database Creation Page

Follow these step-by-step instructions to create a new database on the Blockflow platform.

  1. Log in to your Blockflow dashboard.

  2. On the overview page, locate the navigation bar in the left column.

  3. Click on the "Databases" tab in the navigation bar.

  4. Alternatively, click the "Build a Database" button.

Clicking the Databases tab in the navbar will redirect you to the Databases section, where you can view your existing databases and create new ones. Click on "Create Database" button on the top right

The database creation process involves two main steps: defining configurations and defining the schema.

Step 1: Define Configurations

In this step, you will specify the basic settings and configurations for your new database.

  1. Name: Choose a meaningful name for your database. Please note that the database name cannot contain spaces.

  2. Description: Provide a brief description of your database. This field is for future reference and helps you and your team understand the purpose and contents of the database.

  3. Backup: Select whether you want to enable backup for your database. If you opt-in for backup, Blockflow will maintain multiple copies of your data, ensuring recoverability in case of any issues. We highly recommend enabling backup for your databases.

Step 2: Define Schema

In this step, you will define the structure and organization of your database by specifying the schema. The schema defines the fields, their names, and data types that will be stored in your database.

  1. Adding Fields: To add a new field to your schema, click on the "+" button in the "Define Schema" section. This will create a new row where you can specify the field details.

  2. Field Name: Enter a meaningful name for each field in the "Field Name" column. Choose names that clearly represent the data that will be stored in that field. For example, "UserAddress" for storing user addresses.

  3. Data Type: Select the appropriate data type for each field from the dropdown menu in the "Data Type" column. Blockflow supports various data types, including:

    • String: Used for storing textual data.

    • Integer (Int): Used for storing whole numbers.

    • UUID: Used for storing universally unique identifiers.

    • Map: Used for storing key-value pairs.

  4. Removing Fields: If you need to remove a field from your schema, click on the trash icon next to the field you want to delete. Be cautious when removing fields after creating the database, as this action cannot be undone, and any data stored in that field will be permanently lost.

Best Practices for Schema Design and Database Creation

  • Keep your schema simple and focused on the essential data required for your application.

  • Use meaningful and descriptive field names to improve the readability and maintainability of your schema.

  • Choose appropriate data types for each field based on the nature of the data you plan to store.

  • Avoid making frequent changes to your schema once your database is in use, as schema modifications can be disruptive and may require data migration.

Remember, a well-designed schema is crucial for the performance, scalability, and maintainability of your database. Take the time to carefully plan and design your schema based on your application's requirements and the nature of the data you will be storing. Feel free to schedule a introductory call for us to help you with the process.

Once you have defined your schema, click on the "Create" button to create your database with the specified schema. Blockflow will validate your schema and create the necessary data structures to store your data efficiently.

If you have any questions or need further assistance with schema design, reach out to our Team on Discord.

Last updated