Data Management for VMware Tanzu can use the asynchronous replication machanisms 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 Service Instance that you provision is a standalone instance. A Read Replica Service Instance is a special type of Service Instance clone. When you create a Read Replica, Data Management for VMware Tanzu creates the replica instance from a snapshot of the source instance, and maintains an association between the source and the replica. The source instance assumes the role of Primary, while the Read Replica instance takes on a read-only, supporting role.

Data Management for VMware Tanzu uses the replication method native to the service to synchronize a Primary Service Instance with a Read Replica Service Instance; 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 Service Instance fail.

You can create one or more Read Replicas of a Primary Service Instance; the number of replicas that you are permitted to create depends on the type of service.

If the Primary Service Instance fails, you can manually promote a Read Replica Service Instance to take over as the Primary.

Supported Operations

The following table lists several Data Management for VMware Tanzu management operations, and identifies which operations you can perform on Primary and Read Replica Service Instances:

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
Enable/disable SSH Yes Yes
Enable/disable TLS Yes Yes
Create replica Yes No
Promote replica No Yes
Delete replica Yes No

1 While Data Management for VMware Tanzu does not prevent you from performing these operations on a Read Replica, it is not recommended to do so.

TLS Considerations

When you create a Read Replica Service Instance, Data Management for VMware Tanzu copies the TLS certificates from the original/Primary Service Instance to the replica.

Requiring TLS on client connections to a Primary Service Instance 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 disable the TLS requirement, you must disable it on the Primary and on each Read Replica.

If you regenerate the TLS server certificate on the Primary Service Instance, Data Management for VMware Tanzu also replaces the certificates on each Read Replica Service Instance. Initiating regeneration of the TLS server certificate from a Read Replica syncs the certificate from the Primary.

Creating a Read Replica

Data Management for VMware Tanzu creates a Read Replica Service Instance in the same Onboarded Cluster as the Primary, and deploys the instance on a different host from other instances when both of the following conditions are met:

  1. The Onboarded Cluster is DRS-enabled in fully automated mode.
  2. The number of hosts in the Onboarded Cluster is greater than or equal to the number of Primary plus Replica instances.

Creating and deploying Read Replicas in a DRS-enabled Onboarded Cluster ensures high availability of the service in the face of host failure.

If the above conditions are not met, Data Management for VMware Tanzu randomly deploys a Read Replica Service Instance, and cannot guarantee that the instance will be deployed on a unique host. If Data Management for VMware Tanzu 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.

Note: If you require a service resilient to host failure, VMware strongly recommends that you deploy the instances on a DRS-enabled vSphere cluster operating in fully automated mode.

Prerequisites

Before you create a Read Replica, ensure that the Service Instance from which you want to create the replica:

  • Has backups enabled (Enable Data Protection is on).
  • Is acting in the STAND ALONE role.

Procedure

Perform the following procedure to create a Read Replica:

  1. Select Databases from the left navigation pane.

    This action displays the Databases view, a table that lists the provisioned database instances.

  2. Examine the databases listed in the table, identify the database from which you want to create the replica, and navigate to that table row.

  3. Click the database Instance Name.

    The database information Details tab displays.

  4. Locate the Replication pane, and click + CREATE on the right side of the pane.

    The Create Read Replica dialog displays.

  5. Set the following properties for the Read Replica Service Instance:

    Property Name Value
    DB Instance Name The name of the database Service Instance from which to create the Read Replica. (Read-only)
    Replica Instance Name The name to assign to the Read Replica.
    VM Datastore The VM datastore configuration.
  6. Click CREATE.

    Data Management for VMware Tanzu initiates a management operation of type CREATE_READ_REPLICA, and adds an entry for the new instance in the Databases view table.

    Note: Creating a Read Replica Service Instance and bringing the service online can take some time.

  7. Monitor the progress of the operation in the Operations tab or in the Database Operations view:

    1. Locate the CREATE_READ_REPLICA operation type. The Status progress bar displays the subtasks that Data Management for VMware Tanzu performs for the operation.
    2. Click the CREATE_READ_REPLICA operation type.
    3. Select the State History tab to view the subtasks of the operation and their status.
    4. If the operation fails, select the Error Info tab to examine the returned error information.

      Note: Data Management for VMware Tanzu does not automatically clean up after a failure. If the operation fails, you are responsible for deleting the service instance.

  8. If the operation completes successfully, the new Read Replica Service Instance displays the ONLINE status.

    • The Role of the Service Instance from which you created the Read Replica changes from STAND ALONE to PRIMARY.
    • The new Read Replica Service Instance is acting in the READ REPLICA Role.
    • The Replication pane of the Databases view instance Details displays a table that identifies the Primary and Read Replica Service Instances, their roles, and their status.

Promoting a Read Replica

Promoting a Read Replica is a manual operation. When you promote a Read Replica Service Instance to Primary, Data Management for VMware Tanzu:

  • Decommissions the original Primary Service Instance.
  • Enables write on the Read Replica Service Instance.
  • Moves the FQDN of the original Primary to the Read Replica.
  • Transitions the Read Replica to Primary.
  • Notifies any remaining Read Replicas of the new Primary.
  • Enables write on the original Primary and powers it off if it is reachable.

When you promote a Read Replica to Primary, Data Management for VMware Tanzu also enables protection for the instance and automatically initiates a local and cloud backup.

Promotion is transparent to applications; new connections are automatically routed to the new Primary.

Prerequisites

Before you promote a Read Replica Service Instance to Primary, ensure that:

  • The instance is powered on and online.
  • The instance is acting in the READREPLICA role.
  • You validate that the instance is a good candidate for promotion:
    1. The host is healthy.
    2. The virtual machine is healthy.
    3. The service is healthy.
    4. The replication service is healthy (low replication lag).

Note: Be sure to validate the data consistency of the Read Replica before you promote it to Primary.

Procedure

Perform the following procedure to promote a Read Replica to Primary:

  1. Select Databases from the left navigation pane.

    This action displays the Databases view, a table that lists the provisioned database instances.

  2. Examine the databases listed in the table, identify the Read Replica that you wish to promote to Primary, and navigate to that table row.

  3. Click the database Instance Name.

    The database information Details tab displays.

  4. 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.

  5. If you are absolutely certain that you want to promote the Read Replica to Primary, click CONFIRM.

    Data Management for VMware Tanzu initiates the promote task, generating an operation of type PROMOTE_READ_REPLICA.

  6. Monitor the progress of the operation in the Operations tab or in the Database Operations view:

    1. Locate the PROMOTE_READ_REPLICA operation type and click it.
    2. Select the State History tab to view the subtasks of the operation and their status.
    3. If the operation fails, select the Error Info tab to examine the returned error information.
  7. If the operation completes successfully, the new Read Replica Service Instance displays the ONLINE status:

    • The promoted Service Instance assumes a PRIMARY role if at least one other Read Replica exists, or a STAND ALONE role if it was the sole replica.
    • Data Management for VMware Tanzu enables protection for the new Primary and takes a backup of the Service Instance.
    • The original Primary transitions to a STAND ALONE role, and is POWEREDOFF by Data Management for VMware Tanzu.

Connecting to a Read Replica

Applications can directly connect to a Read Replica Service Instance, but are not permitted to write or change data in the instance.

You can use any SQL client application to connect to a Read Replica Service Instance. Connecting to a Read Replica instance 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 Data Management for VMware Tanzu console as described in Locating the Database Service Instance 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.

check-circle-line exclamation-circle-line close-line
Scroll to top icon