{{announcement.body}}
{{announcement.title}}
refcard cover
Refcard #352

Multi-Region Database Deployments

Patterns and Anti-Patterns for Database Deployments Across Multiple Regions

Modern applications and services demand an always-on, low-latency experience for users no matter where they are on the planet. To meet these requirements, many deploy multiple instances of their applications and services across multiple cloud regions. This legacy approach leaves room for downtime and, even worse, inconsistencies in data. In this Refcard, we explore patterns and anti-patterns to multi-region database deployments — allowing your applications to survive a region failure without downtime while also ensuring consistent and low latency access to data no matter where you do business.

Published: Jun. 03, 2021
192
Free PDF for Easy Reference

Brought to You By

Cockroach Labs
refcard cover

Written By

author avatar Jim Walker
VP of Product Marketing, Cockroach Labs
Table of Contents
Section 1

Introduction

Deployed in the cloud, our modern applications and services demand an always-on, low latency experience for users no matter where they are on the planet. Whether you’re building a startup from the ground up or you are a member of a massive Fortune 500 development organization, these demands are typically the same.  

To meet these requirements, many deploy multiple instances of their applications and services across multiple cloud regions. Some will deploy a database and synchronize it across multiple regions so that they can survive a regional outage as well. It’s not enough. This legacy approach leaves room for downtime and even worse, inconsistencies in data.  

Deployment of an active-active database with multi-region capabilities that can be applied down to the table and row level of your data will allow you to not only survive a region failure without downtime, but also ensure consistent and low latency access to data no matter where you do business.   


This is a preview of the Multi-Region Database Deployments Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 2

What Is a Multi-Region Application?

A multi-region application is deployed across multiple cloud availability zones or regions. This deployment pattern is designed to meet the expectations of a distributed audience while also meeting high availability requirements. Given the nature of this setup, we also consider this application to be “global,” meaning that it may serve audiences across different geographic zones.   

We typically deploy our applications across multiple regions so that we have redundancies and the ability to survive a regional outage. Regional outages may seem unlikely, but they actually occur quite often.  

Usually, an active-passive setup is used for databases, but that deployment style is risky. A new generation of database technologies have emerged that allow for more robust active-active redundancies while also offering the geographical performance improvements required of a truly multi-region application.  

Using a multi-region database delivers several benefits for building distributed applications. Typically, organizations turn to multi-region databases to solve problems such as:  

  • Minimizing transactional latency by placing data physically close to end users 
  • Eliminating outages with redundancies that can survive entire region or cloud failures 
  • Aiding with data privacy compliance by storing data within local boundaries  
  • Delivering a multi/hybrid-cloud deployment to eliminate risk and costs of an “all-in” single cloud approach  

This is a preview of the Multi-Region Database Deployments Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 3

Common Patterns and Anti-Patterns

There are several considerations to take into account when building a multi-region application. Most importantly, we will cover: availability model, databases, and physical deployment/topology patterns. Once you have the right strategy and tools in place, you can successfully adopt a multi-region database.  

Pattern 1: Pick the Best Availability Model 

An active-active availability model enables the database to scale beyond single machines by letting nodes in a cluster serve reads and writes. With this kind of replication, you set up at least two active sites — each of which must contain all of the cluster’s data.  

Client reads and writes from the node in one of the active sites will generate any modifications to other active sites. For many workloads, active-active replication is difficult and expensive to instrument in a database. For that reason, you should consider the type of database you are using to achieve this replication model (more on this below).   

Availability Model Anti-Patterns 

By default, active-passive replication allows one node to receive all the requests and replicate data to a single follower. There are two ways to set this up. Synchronous replication requires that each write to the active node propagates to the passive node. However, if the passive node can’t be reached because it’s down or there's a network partition, the active node can’t progress. Asynchronous replication lets the active node send data to the passive node without guaranteeing that the two nodes’ states mirror one another. When the active node fails, any data that hasn’t been committed to the passive node is lost forever.  

While an active-passive configuration is OK for some use cases, it will struggle to deliver low-latency, consistent transactions and high availability for writes. Simply put, the active-passive availability model is not fit for modern applications.  


This is a preview of the Multi-Region Database Deployments Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 4

Final Thoughts

This Refcard is designed to give you an overview of the benefits of building a multi-region application. As mentioned before, setting up a multi-region deployment is no easy feat. If you are a global organization catering to a global audience, you should take this methodology into consideration.  


This is a preview of the Multi-Region Database Deployments Refcard. To read the entire Refcard, please download the PDF from the link above.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}