Source DB |
Destination DB |
---|---|
|
RDS for PostgreSQL (9.5, 9.6, 10, 11, 12, 13) NOTE:
The major version of the destination database must be the same as or later than that of the source database. |
Table 2 lists the objects that can be synchronized in different scenarios. DRS will automatically check the objects you selected before the synchronization.
Type |
Notes |
---|---|
Objects |
|
To start a synchronization task, the source and destination database users must meet the requirements in the following table. Different types of synchronization tasks require different permissions. For details, see Table 3. DRS automatically checks the database account permissions in the pre-check phase and provides handling suggestions.
Type |
Full |
Full+Incremental |
---|---|---|
Source database user |
The CONNECT permission for databases, the USAGE permission for schemas, the SELECT permission for tables, the SELECT permission for sequences, and the SELECT permission for system table catalog pg_catalog.pg_authid (used for synchronizing user passwords) |
The CONNECT permission for databases, the USAGE permission for schemas, the SELECT permission for tables, the SELECT permission for sequences, the SELECT permission for system table catalog pg_catalog.pg_authid (used for synchronizing user passwords), the UPDATE, DELETE, and TRUNCATE permissions for tables that do not have primary keys, and the permission to create replication connections NOTE:
|
Destination database user |
NOTE:
To synchronize event triggers, text search parsers, and text search templates, the destination database version must be RDS for PostgreSQL 11.11 or later, and the destination database user must be user root or a member of user root. |
To obtain accurate comparison results, start data comparison at a specified time point during off-peak hours. If it is needed, select Start at a specified time for Comparison Time. Due to slight time difference and continuous operations on data, data inconsistency may occur, reducing the reliability and validity of the comparison results.
The full+incremental synchronization process consists of four phases: task startup, full synchronization, incremental synchronization, and task completion. (A single incremental synchronization task or a single full synchronization task contains three phases.) To ensure smooth synchronization, read the following notes before creating a synchronization task.
Type |
Constraints |
---|---|
Starting a task |
|
Full synchronization |
|
Incremental synchronization |
|
Synchronization comparison |
|
Stopping a task |
|
This section uses synchronization from PostgreSQL to PostgreSQL as an example to describe how to configure a real-time synchronization task in the VPC network scenario.
Parameter |
Description |
---|---|
Region |
The region where the synchronization instance is deployed. You can change the region. |
Project |
The project corresponds to the current region and can be changed. |
Task Name |
The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_). |
Description |
The description consists of a maximum of 256 characters and cannot contain special characters !=<>'&"\ |
Parameter |
Description |
---|---|
Data Flow |
Select To the cloud. |
Source DB Engine |
Select PostgreSQL. |
Destination DB Engine |
Select PostgreSQL. |
Network Type |
Available options: VPC, Public network and VPN or Direct Connect. VPC is used as an example. |
Destination DB Instance |
The RDS PostgreSQL DB instance. |
Synchronization Instance Subnet |
Select the subnet where the synchronization instance is located. You can also click View Subnet to go to the network console to view the subnet where the instance resides. By default, the DRS instance and the destination DB instance are in the same subnet. You need to select the subnet where the DRS instance resides and ensure that there are available IP addresses. To ensure that the synchronization instance is successfully created, only subnets with DHCP enabled are displayed. |
Synchronization Mode |
|
Tags |
|
If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically ends.
Establish the connectivity between the DRS instance and the source and destination databases.
The source database can be an ECS database or an RDS instance. Configure parameters based on the database type.
Parameter |
Description |
---|---|
Source Database Type |
Select Self-built on ECS. |
VPC |
A dedicated virtual network in which the source database is located. It isolates networks for different services. You can select an existing VPC or create a VPC. |
Subnet |
A subnet provides dedicated network resources that are isolated from other networks, improving network security. The subnet must be in the AZ where the source database resides. You need to enable DHCP for creating the source database subnet. |
IP Address or Domain Name |
The IP address or domain name of the source database. |
Port |
The port of the source database. Range: 1 – 65535 |
Database Name |
Indicates whether to specify a database. If this option is enabled, enter the database name. |
Database Username |
The username for accessing the source database. |
Database Password |
The password for the database username. |
SSL Connection |
SSL encrypts the connections between the source and destination databases. If SSL is enabled, upload the SSL CA root certificate. NOTE:
|
The IP address, domain name, username, and password of the source database are encrypted and stored in DRS, and will be cleared after the task is deleted.
Parameter |
Description |
---|---|
Source Database Type |
Select an RDS DB instance. |
DB Instance Name |
Select the RDS PostgreSQL instance to be synchronized as the source DB instance. |
Database Username |
The username for accessing the source database. |
Database Password |
The password for the database username. |
Parameter |
Description |
---|---|
DB Instance Name |
The RDS PostgreSQL instance you selected when creating the migration task and cannot be changed. |
Database Username |
The username for accessing the destination database. |
Database Password |
The password for the database username. |
The username and password of the source and destination databases are encrypted and stored in the databases and the synchronization instance during the synchronization. After the task is deleted, the username and password are permanently deleted.
Parameter |
Description |
---|---|
Flow Control |
You can choose whether to control the flow.
|
Incremental Conflict Policy |
The conflict policy refers to the conflict handling policy during incremental synchronization. By default, conflicts in the full synchronization phase are ignored. Select any of the following conflict policies: |
Synchronize |
Available options: Index, Incremental DDLs, and Populate materialized views during the full synchronization phase Populate materialized views during the full synchronization phase: This option takes effect only for materialized views that was populated in the source database. This operation affects the full synchronization performance. You perform this operation after the full synchronization is complete. |
Synchronization Object |
Select Tables or Databases as required.
NOTE:
|
Synchronize Account |
During the synchronization, you can synchronize accounts based on your service requirements. There are two types of accounts: accounts that can be synchronized and accounts that cannot be synchronized. For accounts that cannot be synchronized, you can view details in the Remarks column and determine whether to synchronize accounts and permissions based on your service requirements. |
You can proceed to the next step only when all checks are successful. If there are any items that require confirmation, view and confirm the details first before proceeding to the next step.
Parameter |
Description |
---|---|
Started Time |
Set Start Time to Start upon task creation or Start at a specified time based on site requirements. NOTE:
After a synchronization task is started, the performance of the source and destination databases may be affected. You are advised to start a synchronization task during off-peak hours. |