DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Enterprise AI Trend Report: Gain insights on ethical AI, MLOps, generative AI, large language models, and much more.

2024 Cloud survey: Share your insights on microservices, containers, K8s, CI/CD, and DevOps (+ enter a $750 raffle!) for our Trend Reports.

PostgreSQL: Learn about the open-source RDBMS' advanced capabilities, core components, common commands and functions, and general DBA tasks.

AI Automation Essentials. Check out the latest Refcard on all things AI automation, including model training, data security, and more.

Related

  • Raft in Tarantool: How It Works and How to Use It
  • Split-Brain in Distributed Systems
  • Advantages and Disadvantages of Data Replication in Distributed Databases
  • Simplify Database Geo-Redundancy Backup With Cloud Storage Services

Trending

  • Build Your Own Programming Language
  • Elevate Your Terminal Game: Hacks for a Productive Workspace
  • Enhancing Performance With Amazon Elasticache Redis: In-Depth Insights Into Cluster and Non-Cluster Modes
  • Automated Data Extraction Using ChatGPT AI: Benefits, Examples
  1. DZone
  2. Data Engineering
  3. Databases
  4. Geo-Replication

Geo-Replication

Ensure business continuity and quick disaster recovery as you explore this overview of quorum, global quorum, and the two geo-replication types.

By 
Bhala Ranganathan user avatar
Bhala Ranganathan
·
Mar. 11, 24 · Analysis
Like (1)
Save
Tweet
Share
2.4K Views

Join the DZone community and get the full member experience.

Join For Free

Distributed databases spread across multiple regions use geo-replication to transfer data from one region to another. Such systems use quorum consensus to ensure fault tolerance. The reads and writes should also be ordered. Geo-replication enhances high availability for data systems because if one region goes down other regions are available to serve requests.

Quorum

Quorum graphic

In the above picture, P represents a primary node and S1, S2, and S3 are secondary nodes. P, S1, S2, and S3 combined together represent one replica unit. Each replica unit is fault tolerant; i.e., one node going down will not impact availability. If the primary goes down, one of the remaining secondary nodes will be elected as the next primary. In such a configuration, when a client sends a write request W1 to the primary, the primary, in addition to persisting the data in its storage, will also send the data to all the secondary nodes. The primary will acknowledge back to the client only when the majority of the nodes in the replica unit have acknowledged the write. 

Reads can happen from any node and not just the primary. In the above configuration, the replica unit is fault tolerant to one node failure; i.e., the quorum is achieved when the majority (for example, three out of four) nodes have the write. The lagging node or faulty node can be recovered by copying all the data from a healthy node. When two nodes fail, then a quorum can’t be achieved, because there is no majority.

Geo-Replication and Global Quorum

Geo-replication and global quorum graphic

In geo-replication, in addition to a given primary region having the write operation, the request is also replicated to all other secondary regions. This helps with high availability over region failures. For example, if East US goes down, then West US can serve requests by becoming the new primary region. This action is called failover and can be done automatically or manually. The primary region in this case can acknowledge a write request only when the majority of other secondary regions have seen the write request. This is similar to what happened in a local quorum within a replica unit.

Geo-Replication Types

When a client issues a write request to the primary region, it is replicated to other secondary data regions via a special secondary (XS).  For example, one secondary out of the remaining secondary is elected to do this replication. The XS node will wait for the majority of regions to acknowledge back before it can commit to its store.

There are broadly two types of geo-replication strategies as discussed below:

Synchronous Geo-Replication

In this case, the primary node of the write region waits for an acknowledgement from XS even though it already satisfied its local quorum. For example, it sends an acknowledgement to the client only when there is both local and global quorum.

Asynchronous Geo-Replication

In this case, the primary node of the write region doesn’t wait for an acknowledgement from XS. For example, it can send an acknowledgement to the client when there is local quorum.

As we can see with synchronous geo-replication, the data is never lost. For example, the majority of nodes and regions will have the data. But in asynchronous replication, if only one region knows about the data, then there can be regional outages causing data loss. However, asynchronous replication systems are faster compared to synchronous replication systems because the acknowledgement wait time is shorter. Commercial databases find a balance between the two approaches.

Conclusion

This article gives a brief overview of quorum, global quorum, and the two geo-replication types.  The databases supporting geo-replication offer high availability with manual or automatic failover capabilities. They offer good scalability when data is distributed geographically. These architectures ensure business continuity and quick disaster recovery in case of regional disasters or large-scale outages.

Fault tolerance Data (computing) Quorum (distributed computing) Replication (computing) Distributed database

Opinions expressed by DZone contributors are their own.

Related

  • Raft in Tarantool: How It Works and How to Use It
  • Split-Brain in Distributed Systems
  • Advantages and Disadvantages of Data Replication in Distributed Databases
  • Simplify Database Geo-Redundancy Backup With Cloud Storage Services

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: