Multi-master in cosmosdb / documentdb

How do I set up multiple recording scopes in cosmosdb so that I don't have to combine query results from two or more different scopes in my application layer? From this documentation, it seems that cosmosdb's global distribution is global replication with one script and multiple secondary secondary reads, not true multimaster. https://docs.microsoft.com/en-us/azure/documentdb/documentdb-multi-region-writers

+3


source to share


3 answers


As per the link you provided, based on my understanding. Multi-master in cosmosdb / documentdb is implemented by multiple documents separately for write areas and reads documents from combined query. Currently it seems that it is not supported to configure multiple recording areas in cosmosdb, so there is no need to combine query results from two or more different areas.



+1


source


Beginning in May 2018, the Cosmos database now supports a multi-color system natively using a combination of CRDT data types and automatic conflict resolution.

Azure Cosmos DB's multi-master provides high availability (99.999%), one-time millisecond latency for writing data, and scalability with built-in comprehensive and flexible conflict resolution support.

A multi-master consists of multiple master areas that participate equally in the free-write model (active active template), and it is used to make the data available anytime you need it. Updates made in a particular region are propagated asynchronously to all other regions (which, in turn, are their own regions). Azure Cosmos DB scopes that act as primary scopes in the multimaster configuration automatically works to bring the data of all replicas closer together and ensure global consistency and data integrity.

Azure Cosmos DB implements the logic for handling conflicting records within the database engine itself. Azure Cosmos DB offers comprehensive and flexible support for conflict resolution by providing multiple conflict resolution models, including automatic (CRDT - Conflicting Replicated Data Types), Last Write Wins (LWW), and Custom (Stored Procedure) for automatic conflict resolution. Conflict resolution models ensure correctness and consistency ensures and relieves the burden on developers to think about consistency, availability, performance, replication latency, and complex event combinations in geo-services and cross-regions to write conflicts.



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

+1


source


The article mentions how to implement a multi-master in Cosmosdb while explicitly stating that it is not a multi-master database.

There are ways to "simulate" multi-wizard scenarios by setting up a consistency level (eg, session) that allows callers to see their local copy without writing it to the recording area. You can find information on the different levels here: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels .

Also, consider if you really need a multi-master when working with consistency levels, considering what is acceptable latency, etc. There are several scenarios that cannot tolerate latency, especially when you have adequate tools to ensure that it comes close to a local recording master. There is no such thing as real-time when remote networks are involved;)

0


source







All Articles