Help Center/
Distributed Database Middleware/
Best Practices/
Sharding Database and Table Data of an RDS for MySQL Instance/
Preparing a DDM Instance/
Creating Table Structures in the DDM Instance
Updated on 2022-11-14 GMT+08:00
Creating Table Structures in the DDM Instance
Procedure
- Switch back to the Instances page, locate the instance you created and click Log In in the Operation column.
Figure 1 Logging in to the DDM instance
- In the displayed dialog box, enter the username and password of the DDM account created in Creating a DDM Account and click Log In.
Figure 2 Login window
- Create the same tables as those in the existing RDS instance. You can select to create broadcast, unsharded, or sharded tables based on source table properties. For details about how to use a broadcast and unsharded table, see Using Broadcast and Unsharded Tables.
Figure 3 Source tables
Figure 4 Data in table address_test
Figure 5 Data in table user_test
- Run the following command to create a broadcast table as source table user_test and a sharded table as source table address_test: For SQL statements for creating tables, see Creating a Table.
create table user_test (id char(3), age int(3), name varchar(255),primary key(id)) broadcast;
Figure 6 Creating a broadcast table
create table address_test (id char(3), name varchar(255), address varchar(255),primary key(id)) dbpartition by hash(id);
Figure 7 Creating a sharded table
- View the table creation results.
Figure 8 Viewing table creation results
Parent topic: Preparing a DDM Instance
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot