Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multi-master in cosmosdb/documentdb

How can I set up multiple write regions in cosmosdb so that I do not need to combine query results of two or more different regions in my application layer? From this documentation, it seems like cosmosdb global distribution is global replication with one writer and multiple read secondarys, not true multi-master. https://docs.microsoft.com/en-us/azure/documentdb/documentdb-multi-region-writers

like image 907
russ Avatar asked May 13 '17 00:05

russ


2 Answers

As of May 2018, Cosmos DB now supports multi-master natively using a combination of CRDT data types and automatic conflict resolution.

Multi-master in Azure Cosmos DB provides high levels of availability (99.999%), single-digit millisecond latency to write data and scalability with built-in comprehensive and flexible conflict resolution support.

Multi-master is composed of multiple master regions that equally participate in a write-anywhere model (active-active pattern) and it is used to ensure that data is available at any time where you need it. Updates made to an individual region are asynchronously propagated to all other regions (which in turn are master regions in their own). Azure Cosmos DB regions operating as master regions in a multi-master configuration automatically work to converge the data of all replicas and ensure global consistency and data integrity.

Azure Cosmos DB implements the logic for handling conflicting writes inside the database engine itself. Azure Cosmos DB offers comprehensive and flexible conflict resolution support by offering several conflict resolution models, including Automatic (CRDT- conflict-free replicated data types), Last Write Wins (LWW), and Custom (Stored Procedure) for automatic conflict resolution. The conflict resolution models provide correctness and consistency guarantees and remove the burden from developers to have to think about consistency, availability, performance, replication latency, and complex combinations of events under geo-failovers and cross-region write conflicts.

More details here: https://docs.microsoft.com/en-us/azure/cosmos-db/multi-region-writers


It's currently in preview and might require approval before you can use it:

enter image description here

like image 116
Mani Gandham Avatar answered Sep 18 '22 16:09

Mani Gandham


According to your supplied link, based on my understanding. Multi-master in cosmosdb/documentdb is implemented by multiple documentdbs separately for write regions and read the documents from the combined query. Currently it seems that it is not supported to set up multiple write regions in cosmosdb so that don't need to combine query results of two or more different regions .

like image 25
Tom Sun - MSFT Avatar answered Sep 17 '22 16:09

Tom Sun - MSFT