Cosmos DB is Microsoft's flagship Serverless database service in the Azure cloud. This slide-deck, presented at the Nashville Azure Meetup event on 09/20/2018 covers the why and what of Cosmos DB was is meant to be a good segue into further detailed and advanced topics. The slide-deck presents 3 use-cases for using Cosmos DB in E-Commerce, Healthcare, and IoT. Stay Tuned!
11. Azure Cosmos DB: WHAT?
Microsoft’s PaaS
Database Service
NOSQL
NoSQL
Data Store
Serverless
On-Premise
Cloud
Relational
Data
{}
JSON
Server
Infrastructure
Service
Endpoint
12. Azure Cosmos DB: WHAT?
Multi-Model
Database
Support for
multiple
database APIs
51. Cosmos DB Resource Model
Account
https://woodgrove.documents.azure.com
- R e pr esent s t h e C o s mo s D B I n s t anc e
- E x po s es A c c o u nt -lev el S e t t in gs
o G l o b a l d i s t r i b u t i o n
o C o n s i s t e n c y L e v e l s
o F i r e w a l l
o K e y s
52. Cosmos DB Resource Model
Account
https://woodgrove.documents.azure.com
Database
USA
Database
EUR
Database
AUS
- O n e o r m o r e d a t abas es i n e a c h a c c o u nt
- A c c o u nt -lev el S e t t in gs a p p lied t o e a c h a c c o u nt
o G l o b a l d i s t r i b u t i o n
o C o n s i s t e n c y L e v e l s
o F i r e w a l l
o K e y s
53. Cosmos DB Resource Model
Account
https://woodgrove.documents.azure.com
Database
USA
Database
EUR
Database
AUS
Collection
Customer
Collection
Account
Collection
Transaction
- S i m il ar t o a t ab l e
- R e pr esent s a l o g ic al e n t it y
54. Cosmos DB Resource Model
Account
https://woodgrove.documents.azure.com
Database
USA
Database
EUR
Database
AUS
Collection
Customer
Collection
Account
Collection
Transaction
Items
} E a c h i t em r e pr esent s
a J S O N r e c o r d
55. Cosmos DB Partitioning & Throughput
Account
https://woodgrove.documents.azure.com
Database
USA
Throughput
60. Cosmos DB Throughput
Example Item Size: 1 kb
Reads per sec: 500
Writes per sec: 500
Request Units:
(500 x 1) + (500 x 5) = 3,000 RUs
Request Unit Calculator: https://www.documentdb.com/capacityplanner
64. Cosmos DB Consistency Levels
One writer; multiple readers
Read Latency is acceptable, but data
staleness is NOT.
One version of the truth required for
all readers
65. Cosmos DB Consistency Levels
A certain known degree of staleness
is acceptable
Writes are fast, reads slightly slower
66. Cosmos DB Consistency Levels
Reads lag behind writes by most
k prefixes or t interval
78. Cosmos DB Change Feed
Cosmos DB
Change Feed
Consumer 1
Consumer 2
Consumer 3
79. Cosmos DB Gremlin API
Enables use of graph data model
Allows storage of Vertices, Edges, and Properties
Ideal for highly-connected data
Data queried using Gremlin queries
80. Cosmos DB Use Cases
E-Commerce
Healthcare
IoT
Operational
Analytical
Streaming
82. Use Case: E-Commerce
Region A Region B
Azure
Traffic Manager
App hosted
in Region B
App hosted
in Region A
Cosmos DB
in Region B
Cosmos DB
in Region A
Geo-Distribution