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 database that you provision is a standalone database. A Read Replica database is a special type of clone. When you create a Read Replica, Data Management for VMware Tanzu 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.

Data Management for VMware Tanzu 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.

Note:
  • While you are creating, promoting, or deleting a Read Replica, you cannot start any of these operations on any of the nodes (Primary or Read Replica database node).
  • The version of the ESXi host of the Primary database should not be later than the version of the ESXi host of the Read Replica database.
  • 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 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
    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 database, Data Management for VMware Tanzu 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 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 database, Data Management for VMware Tanzu 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.

    About Remote Read Replicas

    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:

    • You have configured a DNS forward rule from your DNS server to the DNS server of Data Management for VMware Tanzu on the Provider database.
    • There is synch between the NTP servers of vSphere or VMC clusters.

    Creating a Read Replica

    Data Management for VMware Tanzu 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:

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

    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, Data Management for VMware Tanzu randomly deploys a Read Replica database, and cannot guarantee that the database 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 databases on a DRS-enabled vSphere cluster or VMC cluster operating in fully automated mode.

    Prerequisites

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

    • The Primary database has backups enabled (Enable Data Protection is on).
    • The Primary database is acting in the STAND ALONE role.
    • You have configured a DNS forward rule from your DNS server to the DNS server of Data Management for VMware Tanzu on the Provider VM.

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

    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 VM Name.

      The database information Details tab displays.

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

      The Create Read Replica dialog displays.

    5. 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.
      Note: Ensure that the Primary database and the Replica database are able to communicate with each other through the Application Network.
    6. Click CREATE.

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

      Note: Creating a Read Replica database and bringing the service online can take some time.
    7. Monitor the progress of the operation in the Operations tab or in the 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 VM.
    8. If the operation completes successfully, the new Read Replica database displays the ONLINE status.

      • The Role of the database from which you created the Read Replica changes from STAND ALONE to PRIMARY.
      • The new Read Replica database is acting in the READ REPLICA Role.
      • The Replication section of the Cluster Settings tab displays a table that identifies the Primary and Read Replica databases, their roles, and their status.

    Promoting a Read Replica

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

    • Decommissions the original Primary VM.
    • Enables write on the Read Replica VM.
    • 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 database 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 database to Primary, ensure that:

    • The database is powered on and online.
    • The database is acting in the READREPLICA role.
    • You validate that the database 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 VMs.

    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 VM 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 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 database displays the ONLINE status:

      • The promoted database 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 VM.
      • 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 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 Data Management for VMware Tanzu 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.

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