Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing DocumentDB - A NoSQL Database for Microsoft Azure by Ken Casada

Introducing DocumentDB - A NoSQL Database for Microsoft Azure by Ken Casada

In this demo oriented session we will introduce you to Azure DocumentDB, a NoSQL document database-as-a-service. We will discover DocumentDB’s rich feature set, which includes rich querying capabilities by using a SQL-like grammar, transactional processing over schema free data and much more.

Ken is a technical evangelist at Microsoft Switzerland and since more than 14 years he is supporting medium and large companies in the software development on the Microsoft Platform. Before joining Microsoft he was a developer in a bank and in a Microsoft partner company.

Azure Zurich User Group

April 22, 2017

More Decks by Azure Zurich User Group

Other Decks in Technology


  1. #td17ch Introducing DocumentDB – A NoSQL Database for Microsoft Azure

    Ken Casada [email protected] Technical Evangelist Microsoft Switzerland
  2. Definition What is Azure DocumentDB? It’s a fully managed NoSQL

    document database service running on Azure NoSQL ▪ “Non-Relational” would probably be a better term ▪ Different types: ▪ Key-value store (Azure Table Storage, Redis) ▪ column store (Cassandra) ▪ graph databases (Neo4) ▪ document databases (MongoDB, Azure DocumentDB) ▪ Built for scale and performance (designed to scale out) ▪ Great at managing big amount of data ▪ No enforced schema
  3. Document Databases Great for these documents… { id: "mspress", name:

    "Microsoft Press", yearOfFirstPublication: 1984, books: [ { id:"1", name:"DocumentDB 101", numberOfPages: 545 }, { id:"2", name:"DocumentDB for RDBMS users", numberOfPages: 700 } ] }
  4. Document Databases Definitely not for these type of documents…

  5. Demo Getting started with DocumentDB

  6. DocumentDB ▪ Store schema-free JSON documents ▪ Searchable using SQL

    grammar (New: with support for aggregate functions!)  Try out the Query Playground: https://www.documentdb.com/sql/demo ▪ Automatically indexes every property in a document  Optional: reduce storage and processing overhead by defining own indexing policy! (https://docs.microsoft.com/en-us/azure/documentdb/documentdb-indexing-policies)  includes or exclude properties to be indexed  consider using asynchronous (lazy) index updates (default: synchronous) ▪ Scalability & predictable performance (SLA guaranteed) in terms of: ▪ Throughput (RU) @99.99 • Estimate Request Unit and Data Storage: https://www.documentdb.com/capacityplanner ▪ Low latency • Reads < 10ms @99 • Writes < 15ms @99 ▪ SLA also for availability and consistency @99.99  DocumentDB SLA: SLA: https://azure.microsoft.com/en-us/blog/azure-documentdb-service-level-agreements/
  7. DocumentDB ▪ How to add documents to a collection? a.

    Use the Azure Portal b. User the DocumentDB Data Migration Tool in order to import from external data sources: ✓ JSON files ✓ MongoDB ✓ SQL Server ✓ CSV files ✓ Azure Table storage ✓ Amazon DynamoDB ✓ HBase Reference: https://docs.microsoft.com/en-us/azure/documentdb/documentdb-import-data
  8. DocumentDB ▪ How to add documents to a collection? c.

    Programmatically ▪ REST API (https://docs.microsoft.com/en-us/rest/api/documentdb/?redirectedfrom=MSDN) ▪ Client SDK (.NET / .NET core / Java / Python / Node.js / JavaScript) (https://msdn.microsoft.com/library/azure/dn781482.aspx) ▪ Server Side Programming Model (https://docs.microsoft.com/en-us/azure/documentdb/documentdb-programming) ▪ Stored Procedure, Trigger (do not fires automatically) and UDF ▪ Fully Transactional (ACID guarantee)
  9. Demo Using the .NET Client SDK / Server-Side Programming Model

  10. DocumentDB tunable consistency ▪ 4 different consistency levels supported (CONSISTENCY

    vs PERFORMANCE) ▪ STRONG ▪ you are sure all queries return the latest (committed) data  pay in terms of performance (slowest) ▪ write operation is only visible once it is committed durably by the majority of replicas ▪ Only available when you are deploying DocumentDB within a single region! ▪ EVENTUAL ▪ Queries may return stale data before you get the quorum (no waiting  fastest performance) ▪ BOUNDED STALENESS ▪ Queries may return stale data, but that data is guaranteed not be older than a specified time period (you always get the same result, no matter which replicas handles the query) ▪ Example: acceptable to get data older than x minutes ▪ SESSION (DEFAULT ONE) ▪ Scoped to one client session ▪ Strong consistency for the writer, eventual consistency for all other users ▪ Great for lots of scenario!
  11. DocumentDB Global Distribution ▪ DocumentDB deployed within 1 single region

    (all read and writes operations are redirected to the only available region)
  12. DocumentDB Global Distribution ▪ Click on + to add or

    remove regions ▪ Click Save  replication takes place (up to 100TBs within 30 min)
  13. DocumentDB Global Distribution ▪ More regions allows Manual Failover (Read

    region becomes the new Write region)
  14. DocumentDB Global Distribution ▪ Control sequence of regional failover (need

    at least 3 regions)
  15. DocumentDB support for MongoDB App ▪ Use existing MongoDB SDKs

    and tools with DocumentDB ▪ DocumentDB used as data store for apps written for MongoDB ▪ No code changes!!! ▪ https://docs.microsoft.com/en- us/azure/documentdb/documentdb-protocol- mongodb ▪ https://azure.microsoft.com/en- us/blog/documentdb-api-for-mongodb-now- generally-available/
  16. DocumentDB: useful Tools ▪ DocumentDB local emulator (public preview) ▪

    Local environment that emulates the Azure DocumentDB service ▪ No need for an Azure Subscription ▪ For dev/test purposes ▪ Works on Windows 10, Windows Server 2012 R2, Window Server 2016 ▪ Download and more information: https://docs.microsoft.com/en- us/azure/documentdb/documentdb-nosql-local-emulator ▪ Azure DocumentDB Studio ▪ A client management viewer/explorer for Microsoft Azure DocumentDB ▪ Easily browse DocumentDB resources and learn DocumentDB resource model ▪ Support Create, Read, Update, Delete (CRUD) and Query operations ▪ and much more… ▪ Download and more information: https://github.com/mingaliu/DocumentDBStudio
  17. Thank you!