Now that we understand the basics of the Cosmos DB resource model, we will analyze the system topology that is hidden behind the scenes and makes it possible to run the database service at a global scale. The following diagram illustrates the system topology, starting at a Cosmos DB account on Earth, covering up to the fault domains. At the time I was writing this book, Azure didn't have any Moon or Mars regions enabled for Cosmos DB:
As previously explained, Cosmos DB is available in many Azure regions across around the world. Each Azure region has many data centers. Each data center has deployed many big racks known as stamps. The stamps are divided into fault domains that have server infrastructures.
The following diagram illustrates the system topology for each fault domain:
There are clusters with hundreds of servers deployed to many fault domains. The replica sets are deployed to many fault domains to provide an infrastructure that is highly resilient and continues working without issues when hardware failures occur. Each cluster has a database replica with the following elements:
- Resource governor for throughput and latency guarantees
- Transport layer for replication
- Admission control for security (authentication and authorization)
- Database engine to run operations, queries, and indexing