All Products
Search
Document Center

Create a DRDS database

Last Updated: Jul 09, 2020

The database we created on DRDS should be built on the RDS instance. For the stability of the OLTP service, we recommend that you select a new RDS instance for the creation of the DRDS database.

Limits

  • You can only create DRDS databases on the console, DRDS does not support creating databases with SQL commands.

Procedure

  1. Log in to the DRDS console.

  2. Click Instance List in the left navigation pane.

  3. Find the target instance, and click the instance name to enter its Basic Information page.

  4. At the upper right corner of the Basic Information page, Click Create Database.

  5. In the dialog box that pops up, select Partition Mode according to your needs and enter the basic database information.

    • Horizontal Partitioning:DRDS can split data into multiple databases and tables according to the sharding rules. With the help of the horizontal partitioning, you can expand the database horizontally to linearly increase the overall storage capacity and concurrent throughput of the database.
      If you choose Horizontal Partitioning mode:
      1. After filling in the basic information of the database, click Next and select the RDS instance to create the DRDS database.
        • The RDS instance that can be selected as a DRDS data storage node needs to meet all of the following three conditions.
          • The engine type of the target instance is MySQL.
          • The instance is in the running state.
          • The RDS instance is in the same region as the DRDS instance.
        • If the selected RDS instance has a Privileged Account, you will be asked to enter the privileged account and password, which will not be accessed or stored by DRDS and will only be used temporarily in subsequent steps..
      2. Click Next to preview the information of the library creation.

        By default, DRDS creates 8 physical libraries on 1 RDS instance, so the total number of physical sub-libraries is 8 times the number of selected RDS instances.

    • Vertical Partitioning: The existing RDS instances are transferred to the DRDS databases for proxied access to implement read and write splitting. You only need to change the database connection string, username, and password, without importing data or modifying code.
      You can use the DRDS instance-level account for unified authorization management. You can complete joint queries and write operations of transactions across multiple RDS instance databases through one DRDS endpoint.

      You need to upgrade the DRDS version to 5.3.8 or above to use this function.

      If you choose Vertical Partitioning mode:

      1. Select the databases of different RDS instances to complete the batch addition, and set the corresponding database parameters.

        • When selecting an existing account, you can only select the account created on the DRDS console, and it is not supported to add an account created by the create user or grant.
        • The same library name cannot be among multiple added databases.
      2. Click Next to preview the parameters of creating a database.

  6. After previewing and confirming the database parameters, click Next to complete the database creation.

  7. After the creation, on the Database Management page, you can view all of the created database. You can also see the new account in Account Management page.

    The DRDS instance creates the database, account, and DRDS system tables through RDS APIs or the privileged account. Please wait until the database creation is complete with patience.