The Art of Data Residency and Application Architecture

/* A demo of multi-region capabilities in CockroachDB. */

Try the demo

Why a multi-region database?

When your application serves users across states, countries, or continents, you need to make sure you keep your latency low, meet local regulations, and deliver an always-on experience.
The solution: running a multi-region database.

Setting up and managing a multi-region database with traditional tools can be labor intensive. But CockroachDB can help. A distributed SQL database, CockroachDB lets you pin data to specific locations (servers, availability zones, or cloud regions) to optimize latency, comply with regional regulations, and maintain high availability.

In this demo, we illustrate CockroachDB's multi-region capabilities. We're running a single logical CockroachDB serverless instance spanning three AWS regions:

  1. us-east-1
  2. us-west-2
  3. eu-central-1
how it works

Make your own art

In this demo, you'll create art that resides in specific cloud regions. Some data is stored in either the United States or Europe, while other data is stored in both places. That's because the app can write to any region from anywhere.

Try the demo
us data

View the Gallery

When you view the Gallery, you'll only see art that resides in your current location. That's because the app can only read data from your closest region(s). Some data crosses all regions, so you'll always see it.

View the Gallery
us data

Global data

The artwork's pattern and logo settings are stored in both the United States and Europe, and are made available for viewing globally. The data is replicated across all three regions in the CockroachDB cluster. This setting is useful for application data that's universally relevant.

Use the toggle below to understand how the Gallery data is represented in CockroachDB.

User IDImageDataRegion
a_123us_unsplash.com_18RFbOQGCi0.jpg
#B31942#0A3161
πŸ‡ΊπŸ‡Έus-east-1
a_123
topleft,whiteblack
🌎global
a_123eu_unsplash.com_2MoEcGNUj-I.jpg
#FFD700#00966E#D62612
πŸ‡©πŸ‡ͺeu-central-1
b_456us_unsplash.com_42gFAgdIUC8.jpg
#0A3161#FFFFFF
πŸ‡ΊπŸ‡Έus-east-1
b_456
bottomright,purplewhite
🌎global
b_456eu_unsplash.com_hxhZMwfiGdQ.jpg
#0000FF#0B2C5F
πŸ‡©πŸ‡ͺeu-central-1
c_789us_unsplash.com_688Fna1pwOQ.jpg
#B31942#0A3161#FFFFFF
πŸ‡ΊπŸ‡Έus-east-1
c_789
rightbottom,blackpurple
🌎global
c_789eu_unsplash.com_jIh1QFf1naY.jpg
#AE1C28
πŸ‡©πŸ‡ͺeu-central-1
how it works

United States data

Certain images and colors in the demo are stored in the United States. If you're located anywhere in the world except Europe, you can only see United States data in the Gallery.
The data is replicated between CockroachDB instances on the East coast and West coast to provide high availability and guard against regional outages.

Try the demo
us data

European data

Certain images and colors in the demo are stored in Europe and will never be available outside of it. If you're located in Europe, you can only see European data. Given the stringent European data privacy regulations, this capability is especially important.

Try the demo
us data

Learn how it works

We've written an in-depth blog post explaining how we used multi-region AWS architecture together with CockroachDB Serverless to make this demo.

how it works diagram

Get started withCockroachDB today

  • No credit card required
  • Free storage up to 10 GB
  • Single-click deployment