Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Zero to 60 with Azure Cosmos DB

323 views

Published on

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!

Published in: Technology
  • Good info Adnan! Nice job! What software you used to prepare the slides?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Zero to 60 with Azure Cosmos DB

  1. 1. Nashville Azure Meetup NashAzure.com
  2. 2. Instrumentation Logging Log Monitoring Development DevOps Operations Security Compliance Monitoring Governance Coding Unit TestingPerformance Testing Architecture Code Reviews Coded-UI Testing Integration Testing Patching Service Packs Infrastructure EoL Mgmt Procurement Backup Management Disaster Recovery Build Automation Release Pipeline Automated Provisioning Pipeline Orchestration Scripting Continuous Integration Firewall Rules Intrusion Detection Intrusion Prevention Penetration Testing Cybersecurity Data Classification Encryption Alerting Tier 1 Support GDPRSOC 2 Audit ISO 27001 Vendor Management User-Acceptance Testing Risk Management Records Management Configuration Mgmt Asset Tracking Licensing and Renewals
  3. 3. Cosmos DB
  4. 4. Zero to 60 with Azure Cosmos DB
  5. 5. Zero to 60 WHY? WHAT? HOW?
  6. 6. Typical Software Application UI (Front-end) Database (Back-end)
  7. 7. Typical Software Application UI (Front-end) Database (Back-end)
  8. 8. Database Workloads Operational Analytical Streaming App Database Database Insights ML Models Insights ML ModelsDatabaseIoT
  9. 9. Database Workloads Operational Analytical Streaming SQL Data Warehouse Azure Data Lake Hive + Spark Machine Learning Cosmos DB
  10. 10. Azure Cosmos DB: WHAT?
  11. 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. 12. Azure Cosmos DB: WHAT? Multi-Model Database Support for multiple database APIs
  13. 13. Multi-Model Capability MongoDBApp A App B Cassandra App C SQL Server Cosmos DB data migration Cosmos DB data migration Cosmos DB data migration
  14. 14. Multi-Model Capability App A App B App C Cosmos DB Cosmos DB Cosmos DB
  15. 15. Multi-Model Capability App A App B App C Cosmos DB Cosmos DB Cosmos DB
  16. 16. Cosmos DB Data Models Cosmos DB Column Key-Value Document Graph
  17. 17. Cosmos DB Data Models Column Key-Value Document Graph
  18. 18. Cosmos DB Data Models Column Key-Value Document Graph
  19. 19. Application Deployment Scenario Developer Code Application + Database
  20. 20. Application Deployment Scenario Application + Database
  21. 21. Application Deployment Scenario
  22. 22. Application Deployment Scenario Primary Secondary Secondary Secondary Secondary
  23. 23. Application Deployment Scenario Secondary Secondary Secondary Secondary Primary
  24. 24. Application Deployment Scenario Secondary Secondary Secondary Secondary Primary
  25. 25. Application Deployment Scenario Secondary Secondary Secondary Secondary Primary
  26. 26. Geo-Distribution & Failover
  27. 27. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n)
  28. 28. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n)
  29. 29. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  30. 30. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Dashboard (Reads Only)
  31. 31. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  32. 32. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  33. 33. Geo-Distribution & Failover Primary Database Primary Database Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  34. 34. Geo-Distribution & Failover Primary Database Primary Database Secondary (Read Replica 2) Secondary (Read Replica n)
  35. 35. Geo-Distribution & Failover Primary Database Primary Database Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  36. 36. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  37. 37. Geo-Distribution & Failover Primary Database Secondary (Read Replica 1) Secondary (Read Replica 2) Secondary (Read Replica n) Application (CRUD Operations)
  38. 38. Cosmos DB Geo-Distribution West US East US Geo-distribution
  39. 39. Cosmos DB Geo-Distribution East US Geo-distribution West US All Users
  40. 40. Cosmos DB Geo-Distribution East US West US All Users Automatic Failover
  41. 41. Cosmos DB Geo-Distribution East US West US All Users
  42. 42. Cosmos DB Geo-Distribution East US West US All Users
  43. 43. Cosmos DB Geo-Distribution East US West US All Users
  44. 44. Cosmos DB Geo-Distribution
  45. 45. Planet-Scale Geo-Distribution Available for all Azure Regions
  46. 46. Cosmos DB Multi-Master Capability East US Geo-distribution West US All Users Reads + Writes Reads Only
  47. 47. Cosmos DB Multi-Master Capability East US West US New York Reads + Writes Reads + Writes Seattle Data Replication Data Replication
  48. 48. 20 40 60 0 Core Capabilities? Multi-model Geo-Distribution Failover Getting Started Nomenclature Data Migration Programming Model Advanced Topics Change Feed Gremlin API Use-cases
  49. 49. Core Capabilities Multi-model Geo-Distribution Failover 20 40 60 0 Getting Started? Nomenclature Data Migration Programming Model Advanced Topics Change Feed Gremlin API Use-cases
  50. 50. Cosmos DB Nomenclature Resource Model Partitioning & Throughput Consistency Levels
  51. 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. 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. 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. 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. 55. Cosmos DB Partitioning & Throughput Account https://woodgrove.documents.azure.com Database USA Throughput
  56. 56. Cosmos DB Partitioning Account https://woodgrove.documents.azure.com Database USA Partition Key: User Id
  57. 57. Cosmos DB Partitioning Partition Key: User Id hash(User Id) Psuedo-random distribution of data over range of possible hashed values
  58. 58. Cosmos DB Partitioning hash(User Id) …. Adnan Lisa … Partition 1 Partition 2 Partition n Pascal Ali Bob Sonya Rimma Alice Carol …
  59. 59. Cosmos DB Throughput Measured in Request Units (RU’s) 1 RU => Resources required to read 1kb of data
  60. 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
  61. 61. Cosmos DB Consistency Levels 1. Strong 2. Bounded Staleness 3. Session 4. Consistent Prefix 5. Eventual
  62. 62. Cosmos DB Consistency Levels 1. Strong 2. Bounded Staleness 3. Session 4. Consistent Prefix 5. Eventual
  63. 63. Cosmos DB Consistency Levels Geo-distribution and failover are not required.
  64. 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. 65. Cosmos DB Consistency Levels A certain known degree of staleness is acceptable Writes are fast, reads slightly slower
  66. 66. Cosmos DB Consistency Levels Reads lag behind writes by most k prefixes or t interval
  67. 67. Cosmos DB Consistency Levels Read your own writes
  68. 68. Cosmos DB Consistency Levels Never see out of order writes
  69. 69. Cosmos DB Consistency Levels Potential for out-of-order writes
  70. 70. Data Migration to Cosmos DB Azure Portal Cosmos DB
  71. 71. Data Migration to Cosmos DB Cosmos DB MongoDB Cassandra SQL Server Cosmos DB Data Migration Tool
  72. 72. Programming Model Cosmos DB
  73. 73. Programming Model - Stored Procedures - User-defined Functions (UDFs) - Triggers
  74. 74. Core Capabilities Multi-model Geo-Distribution Failover 20 40 60 0 Getting Started? Nomenclature Data Migration Programming Model Advanced Topics Change Feed Gremlin API Use-cases
  75. 75. Core Capabilities Multi-model Geo-Distribution Failover 20 40 60 0 Getting Started Nomenclature Data Migration Programming Model Advanced Topics Change Feed Gremlin API Use-cases
  76. 76. Cosmos DB Change Feed Cosmos DB
  77. 77. Cosmos DB Change Feed Cosmos DB Updates
  78. 78. Cosmos DB Change Feed Cosmos DB Change Feed Consumer 1 Consumer 2 Consumer 3
  79. 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. 80. Cosmos DB Use Cases E-Commerce Healthcare IoT Operational Analytical Streaming
  81. 81. Use Case: E-Commerce
  82. 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
  83. 83. Use Case: Healthcare Point-of-Care (Bedside) Telemetry Notes Prescriptions Test Results HDFS EMR
  84. 84. Use Case: Healthcare EMR Cosmos DB
  85. 85. Use Case: Healthcare Cosmos DB Change Feed Processor Doctor Pharmacy
  86. 86. Use Case: IoT Cosmos DB Sensor Telemetry
  87. 87. Use Case: IoT Cosmos DB Change Feed Processor Cosmos DB SQL Server API
  88. 88. Use Case: IoT Cosmos DB Change Feed Processor Cosmos DB SQL Server API Aircraft Manufacturer US DOT Airline Violations
  89. 89. Core Capabilities Multi-model Geo-Distribution Failover 20 40 60 0 Getting Started Nomenclature Data Migration Programming Model Advanced Topics Change Feed Gremlin API Use-cases
  90. 90. Recap Cosmos DB
  91. 91. Recap Cosmos DB Simplified Management - Provision within minutes - No Infrastructure to manage - No patches/updates
  92. 92. Recap Cosmos DB Disaster Recovery OOTB - HADR/BCDR out-of-the-box - Failover: Automatic + Manual - Minimal to no configuration
  93. 93. Recap Cosmos DB Global Scalability - Geo-Distribution - Planet-scale - Multi-Master support
  94. 94. Recap Cosmos DB Programmability - REST API - Multiple Languages supported - Change Feed for event sourcing REST SDK
  95. 95. Thank You! Azure Databricks Nashville Azure Meetup NashAzure.com

×