VMware Data Services Manager can use the synchronous replication mechanisms built in to MySQL and PostgreSQL to implement high availability in the case of service host failure, and to scale out your read-only workloads.
A database that you provision is a standalone database. A Read Replica database is a special type of clone. When you create a Read Replica, VMware Data Services Manager creates the replica database from a snapshot of the source database, and maintains an association between the source and the replica. The source database assumes the role of Primary, while the Read Replica database takes on a read-only, supporting role.
VMware Data Services Manager uses the replication method native to the service to synchronize a Primary database with a Read Replica database; updates made to the Primary are asynchronously copied to the Read Replica to keep the data in sync. This enables the Read Replica to both serve read requests in addition to the Primary, and to take over should the Primary database fail.
You can create one or more Read Replicas of a Primary database; the number of replicas that you are permitted to create depends on the type of service.
If the Primary database fails, you can manually promote a Read Replica database to take over as the Primary.
The following table lists several VMware Data Services Manager management operations, and identifies which operations you can perform on Primary and Read Replica databases:
Operation | Primary | Read Replica |
---|---|---|
Enable protection | Yes | No |
Automated backup | Yes | No |
Manual backup | Yes | No |
Clone | Yes | No |
Delete | Yes | Yes |
Extend disk | Yes | Yes1 |
Configure compute resources | Yes | Yes1 |
Activate or Deactivate SSH | Yes | Yes |
Activate or Deactivate TLS | Yes | Yes |
Create replica | Yes | No |
Promote replica | No | Yes |
Delete replica | Yes | No |
1 While VMware Data Services Manager does not prevent you from performing these operations on a Read Replica, it is not recommended to do so.
When you create a Read Replica database, VMware Data Services Manager copies the TLS certificates from the original/Primary database to the replica.
Requiring TLS on client connections to a Primary database does not automatically require TLS on its Read Replicas. You must manually configure each of its Read Replicas to require TLS. Similarly, if you want to deactivate the TLS requirement, you must deactivate it on the Primary and on each Read Replica.
If you regenerate the TLS server certificate on the Primary database, VMware Data Services Manager also replaces the certificates on each Read Replica database. Initiating regeneration of the TLS server certificate from a Read Replica syncs the certificate from the Primary.
If an Organization has multiple vSphere or VMC clusters managed by a single vCenter, you can create a database as the Remote Read Replica in a cluster that is different from where the Primary database is. When you want to configure Remote Read Replicas, ensure the following:
VMware Data Services Manager creates a Read Replica database in the same Onboarded Cluster as the Primary, and deploys the database on a different host from other databases when both of the following conditions are met:
Creating and deploying Read Replicas in a DRS-enabled Onboarded Cluster ensures high availability of the database the face of host failure.
If the above conditions are not met, VMware Data Services Manager randomly deploys a Read Replica database, and cannot guarantee that the database will be deployed on a unique host. If VMware Data Services Manager deploys the Read Replica on the same host as the Primary and the host fails, there is no reliable recovery mechanism short of restoring from a backup.
Before you create a Read Replica, ensure that the database from which you want to create the replica:
Perform the following procedure to create a Read Replica:
Select Databases from the left navigation pane.
This action displays the Databases view, a table that lists the provisioned VMs.
Examine the databases listed in the table, identify the database from which you want to create the replica, and navigate to that table row.
Click the database VM Name.
The database information Details tab displays.
Locate the Replication section, and then click + CREATE on the right side of the section.
The Create Read Replica dialog displays.
Set the following properties for the Read Replica VM:
Property Name | Value |
---|---|
VM Name | The name of the VM from which to create the Read Replica. (Read-only) |
Replica VM Name | The name of the VM to assign to the Read Replica. |
Namespace | The Namespace that will be assigned to the Read Replica. |
Click CREATE.
VMware Data Services Manager initiates a management operation of type CREATE_READ_REPLICA, and adds an entry for the new database in the Databases view table.
Monitor the progress of the operation in the Operations tab or in the Operations view:
Locate the CREATE_READ_REPLICA operation type. The Status progress bar displays the subtasks that VMware Data Services Manager performs for the operation.
Click the CREATE_READ_REPLICA operation type.
Select the State History tab to view the subtasks of the operation and their status.
If the operation fails, select the Error Info tab to examine the returned error information.
If the operation completes successfully, the new Read Replica database displays the ONLINE status.
Promoting a Read Replica is a manual operation. When you promote a Read Replica database to Primary, VMware Data Services Manager:
When you promote a Read Replica to Primary, VMware Data Services Manager also enables protection for the database and automatically initiates a local and cloud backup.
Promotion is transparent to applications; new connections are automatically routed to the new Primary.
Before you promote a Read Replica database to Primary, ensure that:
Perform the following procedure to promote a Read Replica to Primary:
Select Databases from the left navigation pane.
This action displays the Databases view, a table that lists the provisioned VMs.
Examine the databases listed in the table, identify the Read Replica that you wish to promote to Primary, and navigate to that table row.
Click the database VM Name.
The database information Details tab displays.
Click the DATABASE ACTIONS button in the top right corner of the view, and select Promote Replica from the drop-down menu.
The Promote Read Replica dialog displays.
If you are absolutely certain that you want to promote the Read Replica to Primary, click CONFIRM.
VMware Data Services Manager initiates the promote task, generating an operation of type PROMOTE_READ_REPLICA.
Monitor the progress of the operation in the Operations tab or in the Operations view:
If the operation completes successfully, the new Read Replica database displays the ONLINE status:
Applications can directly connect to a Read Replica VM, but are not permitted to write or change data in the database.
You can use any SQL client application to connect to a Read Replica VM. Connecting to a Read Replica database requires its fully-qualified distinguished name (FQDN), the database name, database server port number, and administrative user credentials. You can obtain this information from the VMware Data Services Manager console as described in Locating the Database Connection Parameters.
Promotion of a Read Replica is transparent to applications; new connections will be automatically routed to the new Primary. Note, however, that there may be a period of connectivity loss during promotion; applications should include retry logic that attempts to reconnect in the event of a dropped connection.