CompanyJanuary 5, 2023

Enhanced Multi-Region Consistency in Astra DB

Craig Kitterman
Craig Kitterman
Enhanced Multi-Region Consistency in Astra DB

Enhancements to multi-region databases in Astra DB provide additional consistency options (EACH_QUORUM and SERIAL) to ensure data is immediately written to a majority of replicas on all configured regions. SERIAL consistency also enables the use of Lightweight Transactions (LWTs) in multi-region deployments.

Last year we announced support for multi-region serverless databases in Astra DB. Astra DB multi-region databases enable a powerful yet simple option for business continuity, and provide ultra-low latency experiences to end users globally from a single database—all with lower total cost of ownership (TCO) than traditional multi-region deployment architectures. Enabling this capability is as easy as a few clicks in the Astra DB portal, or a simple API call through the Astra DevOps API. 

In Astra DB, all regions in a multi-region database are “active” and can accept reads and writes.  The replication between regions is handled automatically. In the case of a typical write,  LOCAL_QUORUM consistency would be observed, ensuring that the data was successfully written to a majority of replicas within the region accepting the initial write, before returning a response to the requesting client. Replication to the other region(s) would then be a “fire and forget” operation, passing the data along, but not blocking on a response from the other regions.  Any cross-region write operation that failed would be handled by a periodic asynchronous repair operation, ensuring eventual consistency between the regions. Unfortunately, given the lag introduced by the asynchronous repair, it was often difficult to know with certainty whether a write had reached all regions and data in all the regions was in sync. For some application types, the potential for this uncertainty is untenable. 


Ensure data replication to configured regions

Today, DataStax is introducing support for an ‘EACH_QUORUM’ consistency model for multi-region Astra DB databases. With EACH_QUORUM, Astra DB will ensure the data has been successfully written to a majority of replicas on all configured regions prior to returning a response to the client. This provides instant assurance that a write has reached all configured regions, and the data in all the regions is in sync, and no additional repair operation is needed. 

DataStax is also introducing support for a SERIAL consistency model using Lightweight Transactions (LWTs) for multi-region deployments. The SERIAL consistency model ensures that data is consistent and correct across regions using a distributed "compare-and-set" operation implemented via the Paxos algorithm. Compare-and-set manages consistency without the need for error-prone locking mechanisms that can lead to concurrency issues.  

Additionally, this update introduces better support for cross-region hinted handoff, to regain consistency quicker in case of failures without having to wait for repair operations.

For more information on configuring multi-region databases in Astra DB, see the Astra DB serverless documentation. We look forward to your continued feedback!

Discover more
DataStax Astra DBDataStaxReleases
Share

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.