This topic describes the database grouping feature of Data Management Service (DMS) and how to create a database group. When you create a data change ticket, you can select a database group as target databases without the need to select the databases one by one. When you create a schema design ticket, you can synchronize the operation on the base database to all the other databases in the same database group as the base database.
Prerequisites
- All the instances to which the databases belong are in Secure Collaboration mode.
- The databases are all physical databases or are all logical databases.
- All the databases are deployed in the same environment, such as the development environment.
- The engines of the databases are of the same type. For example, the databases are all MySQL databases.
Background information
You may deploy your business in multiple regions and have multiple databases. In this case, every time you want to perform a change, you must perform the change on all the databases. This requires you to remember the endpoints of all the databases in the different regions. To perform a data change, you must select all the databases as target databases in a ticket. To perform a schema change, you must create a ticket for each database. However, you may accidentally omit one or more databases, which will pose risks to the stability of your business. In addition, if you have a large number of databases, you may spend time and energy selecting all the databases. This is also prone to errors.
Therefore, DMS provides the database grouping feature to solve this problem. You can put multiple databases that are of the same type and deployed in the same environment in a database group. When you create a data change ticket or a schema design ticket, you must select at least one target database or a base database, respectively. If a selected database is in a database group, a message appears, asking if you want to perform the current operation on all the databases in the database group. If you click OK in the message, DMS will add all the other databases in the group as target databases, or synchronize the current schema change to all the other databases in the group.
Create a database group
Scenarios
- Data change
When you create a data change ticket, you must select at least one target database. After you select a database that is in a database group, a message appears, reminding you that the selected database is in a database group. If you click OK in the message, DMS will add all the other databases in the group as target databases. If you click Cancel in the message, the other databases in the group will not be selected as target databases. The following figure shows the message.
Note that the data change ticket must be a Normal Data Modify ticket, a Lock-Free Data Modify ticket, a History Data Clean ticket, a Large Data Import ticket, or a Programmable Object ticket. For information about how to create a ticket, click the corresponding link.
- Schema design
When you create a schema design ticket, you must select a database as a base database. If the selected database is in a database group, a message appears after you click Perform Changes to Base Database, reminding you that the base database is in a database group and the current operation will also be performed on all the other databases in the group. The following figure shows the message.
For more information about how to use the schema design feature, see Schema design.