Column-family Document Graph Turnkey global distribution Elastic scale out of storage & throughput Guaranteed low latency at the 99th percentile Comprehensive SLAs Five well-defined consistency models Table API Key-value A globally distributed, massively scalable, multi-model database service Azure Cosmos DB MongoDB
Azure Cosmos DB Multi Master Every region now writable Single-digit latency 99.999% availability Tunable consistency levels Flexible conflict resolution Unlimited endpoint scalability All Azure regions All data models All SDK’s Region A Region B Region C Azure Traffic Manager Master (read/write) Master (read/write) Master (read/write) Master (read/write) Replica (read) Replica (read)
Custom – User Defined Procedure Register stored procedure Special signature Conflict dropped after Processing. If error then written to Conflict feed, handled manually.
99.99% SLA for Low latency reads + writes • Reads and writes served from local region • Guaranteed millisecond latency worldwide • Write optimized, latch-free database engine • Automatically indexed SSD storage Reads (1KB) Indexed writes (1KB) Read < 2 ms Writes < 6 ms Read < 10 ms Writes < 15 ms 99% 50% • Synchronous and automatic indexing at sustained ingestion rates • No schema or index management needed • No schema versioning needed • No schema migration needed
What is RU? • Request Unit • Not all requests are equal. • A normalized quantity of request unit based on the amount of computation (CPU, memory, and IOPS) required to serve the request.
Request Unit Management Single Partition Container Partitioned Container Minimum Throughput 400 RU/sec 1.000 RU/sec Maximum Throughput 10.000 RU/sec Unlimited Offer offer = client.CreateOfferQuery() .Where(r => r.ResourceLink == collection.SelfLink) .AsEnumerable().SingleOrDefault(); offer = new OfferV2(offer, 12000); client.ReplaceOfferAsync(offer); A partition key is required to scale your collection's throughput beyond 2,500 request units in the future
Bounded Staleness When choosing bounded staleness, the "staleness" can be configured in two ways: number of versions K of the item by which the reads lag behind the writes, and the time interval t 01 Strong Bounded Staleness Session Consistent Prefix Eventual Lower latency, higher availability, better read scalability.
Consistent Prefix Consistent prefix guarantees that reads never see out of order writes. If writes were performed in the order A, B, C, then a client sees either A, A,B, or A,B,C, but never out of order like A,C or B,A,C. 01 Strong Bounded Staleness Session Consistent Prefix Eventual Lower latency, higher availability, better read scalability.
Native Support for Multiple Data Models • Database engine operates on atom-record-sequence (ARS) based type system • All data models are efficiently translated to ARS • API and wire protocols are supported via extensible modules • Instance of a given data model can be materialized as trees • Graph, documents, key-value, column-family, … more to come KEY-VALUE COLUMN-FAMILY DOCUMENT GRAPH
4 Axis SLA Latency @ 99th percentile SLA Throughput SLA Consistency SLA Availability SLA 2 4 3 1 Cosmos DB: 99.99% HA within a single region 99.999% across regions 99.99 SLA throughput, latency, consistency all at the 99th percentile
Disclaimer • Cosmos DB is not a SQL Database, no complex table joins. (you are doing it wrong) • Other NoSQL databases are good at doing one or two things really well but not native to Cloud.