2015 International TechNet Wiki Summit 2015 Creating and Querying Microsoft Azure DocumentDB Chervine Bhiwoo
Meet Chervine 2 Software Developer From Mauritius – Indian Ocean - Africa Works mainly on Microsoft Technologies such as C# and ASP.NET. Also has a good knowledge on BI, Data- warehousing, MS Azure and Windows Phone /
In this session TechNet Wiki Why DocumentDB..? Introduction to Azure DocumentDB Creating a DocumentDB Account Storing & Querying Data Using Azure DocumentDB in as ASP.NET MVC Application Code Samples on Gallery 3
TechNet Wiki 4 1.Articles about Microsoft Azure 1. default.aspxhttp://social.technet.microsoft.com/wiki/contents/articles/tags/Microsoft+Azure/ default.aspx 2.Creating and Querying Microsoft Azure DocumentDB 1. azure-documentdb-in-an-asp-net-mvc-application.aspxhttp://social.technet.microsoft.com/wiki/contents/articles/29717.using-microsoft- azure-documentdb-in-an-asp-net-mvc-application.aspx 3.Using Microsoft Azure DocumentDB in an ASP.NET MVC Application 1. azure-documentdb-in-an-asp-net-mvc-application.aspxhttp://social.technet.microsoft.com/wiki/contents/articles/29717.using-microsoft- azure-documentdb-in-an-asp-net-mvc-application.aspx 4.Other articles by Chervine 1. aspxhttp://social.technet.microsoft.com/wiki/contents/articles/tags/Chervine/default. aspx
Why..? Applications load balance varies rapidly and application should be able to adapt 5 Modern Applications produce and consume incredibly high volume of data Users today expects near instantaneous response times Applications Database models are no longer fixed and evolve continuously
What is Azure DocumentDB? It is a fully managed, highly scalable, queryable, schema- free document database, delivered as a service, for modern applications. 6
What is DocumentDB? 7 Query against Schema-Free JSON Multi-Document transactions Tunable, High Performance Designed for cloud first
Azure DocumentDB Resources 8 Source:
The DocumentDB Data Model 9 All data is stored in JSON Documents Object created in code Object saved in Database
Demo: Creating a DocumentDB Account 10 From the preview portal ( click on New > Data + Storage > DocumentDB, fill in the required information and click create.
Demo: Querying DocumentDB (1) 11 Create an instance of DocumentClient Create a DocumentDB Database Create a Document Collection Create & Save Documents Provides a client-side logical representation of the Azure DocumentDB service The method CreateOrGetDatabase check if the database already exists, if not, it will create it and return an instance of the database A document collection is a named logical container for documents. The method CreateOrGetCollection returns the collections if it already exists, else it will create the collection. To save documents, the method CreateDocumentAsync is used which creates a document as an asynchronous operation.
Demo: Querying DocumentDB (2) 12 Query Documents Update Documents Delete Documents Both SQL and LINQ can be used to retrieve data from DocummentDB using the CreateDocumentQuery method. You first need to get the document to update, make the changes and replace the document using the ReplaceDocumentAsync mthod Get the required document and delete it using the DeleteDocumentAsync method
Demo: Azure DocumentDB and ASP.NET MVC Application (1) 13 Request Controller Model View DocumentDB Repository Azure DocumentDB Application Architecture and Flow
Demo: Azure DocumentDB and ASP.NET MVC Application (2) 14 Instantiate DocumentClient Get DatabaseGet Collection Do CRUD Operations Provides a client-side logical representation of the Azure DocumentDB service. The Method ReadOrCreateDatabase will create the database if it does not exist The Method ReadOrCreateCollection will create the collection if it does not exist After getting the database and collection, Create, Read, Update and Delete operations can be done. The DocumentDB Repository Flow
Gallery Download 15 1.Creating and Querying Microsoft Azure DocumentDB 1.Gallery Download: Using Microsoft Azure DocumentDB in an ASP.NET MVC Application 1.Gallery Download:
16 Thank You!