Synchronous multi region (3+ regions)

Distribute data synchronously across regions

For protection in the event of the failure of an entire cloud region, you can deploy YugabyteDB across multiple regions with a synchronously replicated multi-region universe.

In a synchronized multi-region universe, a minimum of three nodes are replicated across three regions with a replication factor (RF) of 3. In the event of a region failure, the universe continues to serve data requests from the remaining regions. YugabyteDB automatically performs a failover to the nodes in the other two regions, and the tablets being failed over are evenly distributed across the two remaining regions.

This deployment provides the following advantages:

  • Resilience - putting the universe nodes in different regions provides a higher degree of failure independence.
  • Consistency - all writes are synchronously replicated. Transactions are globally consistent.

Create a synchronized multi-region universe

Before you can create a multi-region universe in YugabyteDB Anywhere, you need to install YugabyteDB Anywhere and configure it to run in AWS. For region-level placement, refer to Plan your universe. Then create the universe.

Start a workload

Follow the setup instructions to install the YB Workload Simulator application, connect it, and then start a workload.

To verify that the application is running correctly, navigate to the application UI at http://localhost:8080/ to view the universe network diagram, as well as latency and throughput charts for the running workload.

View the universe activity

You can use YugabyteDB Anywhere to view per-node statistics for the universe, as follows:

  1. Navigate to Universes and select your universe.

  2. Select Nodes to view the total read and write operations for each node.

    Note that both the reads and the writes are approximately the same across all the nodes, indicating uniform load.

  3. Select Metrics to view charts such as YSQL operations per second and latency.

Tune latencies

Latency in a multi-region universe depends on the distance and network packet transfer times between the nodes of the universe as well as between the universe and the client. Because the tablet leader replicates write operations across a majority of tablet peers before sending a response to the client, all writes involve cross-region communication between tablet peers.

For best performance and lower data transfer costs, locate your universe as close to your applications as possible. Refer to Provider and region.

Follower reads

YugabyteDB offers tunable global reads that allow read requests to trade off some consistency for lower read latency. By default, read requests in a YugabyteDB universe are handled by the leader of the Raft group associated with the target tablet to ensure strong consistency. If you are willing to sacrifice some consistency in favor of lower latency, you can choose to read from a tablet follower that is closer to the client rather than from the leader. YugabyteDB also allows you to specify the maximum staleness of data when reading from tablet followers.

For more information, see Follower reads examples.

Preferred region

If application reads and writes originate primarily from a single region, designate it as preferred so tablet leaders pin to that region. Ranking does not change replica placement. Refer to Preferred region.

To set or change preferred regions after the universe exists, refer to Scale universes.

To verify that the load is moving to the preferred region, select Nodes. When complete, the load is handled exclusively by the preferred region.

With the tablet leaders located in the region to which the application is connected, latencies decrease and throughput increases.

Note that cross-region latencies are unavoidable in the write path, given the need to ensure region-level automatic failover and repair.