Successfully reported this slideshow.

Microsoft Azure DocumentDB - Global Azure Bootcamp 2016

0

Share

1 of 21
1 of 21

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Microsoft Azure DocumentDB - Global Azure Bootcamp 2016

  1. 1. Microsoft Azure DocumentDB Microsoft’s NoSQL Database as a Service Global Azure Bootcamp 2016 Sunny SharmaC# Corner – Delhi Chapter
  2. 2. < Who am I /> • Sunny Sharma • Lead Developer @ C# Corner • C# Corner MVP • Author / Trainer / Speaker • t: @sunny_delhi • http://codeflair.net
  3. 3. DocumentDB – Core Features • Schema-less, NoSQL Document database • JSON documents • Transactional support with ACID semantics • Tunable Consistency • Excellent Search Speed without SQL • Restful API • Async Support • Fully Managed
  4. 4. Tunable Consistency Levels • Strong • Session • Bounded Staleness • Eventual
  5. 5. Consistency Levels • Client always see completely consistent data • Slowest read/write • Applicable to areas: Airline / Banking / Stock Market Strong
  6. 6. Consistency Levels • Client reads its own writes, while other clients reading this same date might see older values. Session (default option)
  7. 7. Consistency Levels • Client might see old data, but it can specify how old that data can be, let’s say 3 seconds! • Updates happen in order received • Similar to Session consistency, but speeds up the reads while still preserving the order of updates. Bounded Staleness
  8. 8. Consistency Levels • Client might see old data for as long as it takes a write to propagate to all replicas • High performance & availability • Client might see updates out of order Eventual
  9. 9. Resource Model
  10. 10. Sample JSON document { "Event": "Global Azure Bootcamp", "Year":"2016", "Session": "Learn DocumentDB - Microsoft's NoSQL database", "Speaker": "Sunny Sharma", "Hours":"02:30 PM-03:30 PM", "Other Sessions":[ { "Name": "IoT With Azure", "Speaker":"Prabhjot Singh", "Hours":"01:30 PM-02:30 PM" }, { "Name": "Introduction to Azure Application Insights", "Speaker": "Mohit Chhabra", "Hours":"03:30 PM-04:30 PM" } ], "Venue": "C# Corner - Delhi Chapter“, “id”:”20160416” }
  11. 11. Resource Addressing • Native REST Interface • Each resource has a permanent unique ID • API URL: • https://{database account}.documents.azure.com • Document Path: • /dbs/{database id}/colls/{collection id}/docs/{document id}
  12. 12. Operations For each Resource: • Create / Replace / Delete / Read / Query • Read is a GET operation on a specific resource ID, returning a single resource. • Query is a POST operation on a collection with a request body containing DocumentDB SQL text, returning a possible empty collection of resources. • Query can filter on indexed properties.
  13. 13. Stored Procedures, Triggers and UDFs • DocumentDB supports server-side JavaScript • Stored Procedures: • Registered at collection level • Operate on any document in the collection • Invoked inside transaction context on primary replica • Triggers: • Pre- or Post: create, replace or delete operations • Invoked inside transaction context on primary replica • User-Defined Functions: • Scalar functions invoked only inside queries
  14. 14. Support • .NET (LINQ to SQL is supported) • Node.js • JavaScript • Python • Java • Hadoop
  15. 15. When should you use? In General • You don’t want to do replication and scale-out by yourself • You want to have tunable consistency • You want to do rapid development Compared to relational databases • You don’t want predefined columns Compared to other document stores Compared to other document stores • You want to use a SQL-like grammar
  16. 16. Pricing • http://bit.do/documentdb-pricing • Capacity Units (CU) • Capacity • Throughput (in terms of rate of transactions / second) • Request Units (RU) = 2000 request per second • “Request” depends on the size of the document ex. Uploading 1000 large JSON documents might count as more than one request
  17. 17. Limitations & Quota Entity Quota (Standard Offer) Database Accounts* 50 Maximum document storage per database account* 1 TB (or higher by request) Provisioned document storage* / collection 250 GB (or higher by request) Maximum Request Units / second per collection 250,000 RU/s(or higher by request) Maximum request size of document 512KB Maximum execution time for stored procedure and trigger 5 seconds
  18. 18. References • DocumentDb CheatSheet • http://bit.ly/documentdb-cheatsheet • DocumentDB Query Playground • http://bit.ly/documentdb-playground • Visual Studio Dev Essentials • http://bit.ly/vsdev-essentials
  19. 19. Demo time!
  20. 20. Questions ?

Editor's Notes

  • Fully Managed: Scaled over azure, not to think about VM manipulation.
  • Azure SQL bills by DTU (Data Through-put Unit)
  • Azure SQL bills by DTU (Data Through-put Unit)
  • ×