Amazon recently announced support for global clusters on DocumentDB, the document-oriented database compatible with MongoDB.
The new feature allows users to deploy clusters that span across multiple AWS regions and provides disaster recovery from region-wide outages using storage-based replication. Global clusters replicate data to up to five regions and enable low-latency global reads, with each secondary region supporting up-to 16 replica instances.
Introduced by AWS in 2019, DocumentDB is a managed NoSQL database service that supports document data structures for MongoDB workloads. Global clusters is a new optional feature available for DocumentDB v4.0 and provides fast replication across regions with latencies less than one second. Relying on storage-based physical replication of data, the compute instances in the primary and secondary regions do not participate in the replication process, serving only application requests.
Disaster recovery from region-wide outages, global reads with low latency, scalable secondary clusters and high-speed replication across clusters are the main use cases of running global clusters in Amazon DocumentDB.
In a separate article and in a video, Karthik Vijayraghavan, senior DocumentDB specialist solutions architect at AWS, shows how the new feature works and how it can improve availability:
A global cluster consists of a primary cluster that allows read and write operations, and up to five secondary clusters in other Regions, which allow read operations. The replication from primary to secondary clusters is unidirectional and allows you to create active-passive deployment.
Source: https://aws.amazon.com/blogs/database/introducing-amazon-documentdb-with-mongodb-compatibility-global-clusters/
DocumentDB is not the first product in the MongoDB ecosystem to provide distributed capabilities: MongoDB Atlas offers read-only replication and Microsoft Azure Cosmos DB supports distributed read/write capabilities. MongoDB maintains a page with a comparison of the different MongoDB as a service offerings and a site to highlight the failed compatibility tests.
Regardless of the new replication feature, some users still see limited use cases for choosing DocumentDB as a database on AWS. Suggesting to use DynamoDB instead, Adam Elmore, cloud technology consultant, tweets:
The only case for DocumentDB is existing Mongo workloads.
while Corey Quinn comments on the latest feature in his newsletter:
This thing feels more and more like a shim on top of DynamoDB all the time.
Among the current limitations of global clusters, they are not supported on t3 and r4 instance types, a promotion of a secondary cluster in the event of a regional failover is not automatic and only the primary cluster can perform write operations. Furthermore, AWS CloudFormation does not support global clusters and change streams cannot be used on secondary clusters.
The pricing model of global clusters is similar to other distributed services on AWS: the customer is charged for replicated write I/Os between the primary region and each secondary region and standard DocumentDB rates apply for instances, storage, cross-region data transfer, and backup storage.