Learning Azure DocumentDB: Create outstanding enterprise solutions around DocumentDB using the latest technologies and programming tools with Azure
()
About this ebook
Learning DocumentDB adopts a practical, step-by-step approach to help you learn the basics of DocumentDB and use your new-found abilities in real-life scenarios and enterprise solutions.
We start with the absolute basics, such as setting up a DocumentDB environment, and guide you through managing your databases, and executing simple and complex queries. Next, we explain how to work with DocumentDB using the open REST protocol, and demonstrate how JavaScript works with DocumentDB. We’ll also show you how to authenticate and execute queries. Moving on, you’ll find out how to use DocumentDB from within Node.js to kick-start your Node.js projects. Next, you’ll discover how to increase the performance of your DocumentDB database and fine-tune it.
Finally, you’ll get to grips with using DocumentDB in conjunction with other services offered from the Microsoft Azure platform.
Read more from Becker Riccardo
Windows Azure programming patterns for Start-ups: A step-by-step guide to create easy solutions to build your business using Windows Azure services with this book and ebook. Rating: 0 out of 5 stars0 ratingsLearning Azure DocumentDB Rating: 0 out of 5 stars0 ratings
Related to Learning Azure DocumentDB
Related ebooks
Guide to NoSQL with Azure Cosmos DB: Work with the massively scalable Azure database service with JSON, C#, LINQ, and .NET Core 2 Rating: 0 out of 5 stars0 ratingsWindows Azure programming patterns for Start-ups Rating: 0 out of 5 stars0 ratingsHands-On Cloud Solutions with Azure: Architecting, developing, and deploying the Azure way Rating: 0 out of 5 stars0 ratingsCloud Native Python: Build and deploy resilent applications on the cloud using microservices, AWS, Azure and more Rating: 0 out of 5 stars0 ratingsKnockoutJS Blueprints Rating: 0 out of 5 stars0 ratingsASP.NET Core 6 and Angular: Full-stack web development with ASP.NET 6 and Angular 13 Rating: 0 out of 5 stars0 ratingsDocker and Kubernetes for Java Developers Rating: 0 out of 5 stars0 ratingsC# 7 and .NET Core 2.0 Blueprints: Build effective applications that meet modern software requirements Rating: 0 out of 5 stars0 ratingsLearning NServiceBus Sagas Rating: 0 out of 5 stars0 ratingsHybrid Cloud for Developers: Develop and deploy cost-effective applications on the AWS and OpenStack platforms with ease Rating: 0 out of 5 stars0 ratingsMicrosoft Azure IaaS Essentials Rating: 4 out of 5 stars4/5JavaScript Cloud Native Development Cookbook: Deliver serverless cloud-native solutions on AWS, Azure, and GCP Rating: 0 out of 5 stars0 ratingsMastering ServiceStack Rating: 0 out of 5 stars0 ratingsHands-On Azure for Developers: Implement rich Azure PaaS ecosystems using containers, serverless services, and storage solutions Rating: 0 out of 5 stars0 ratingsHybrid Cloud for Architects: Build robust hybrid cloud solutions using AWS and OpenStack Rating: 0 out of 5 stars0 ratingsLearning Docker - Second Edition Rating: 0 out of 5 stars0 ratingsMastering Cloud Development using Microsoft Azure Rating: 0 out of 5 stars0 ratingsCodeIgniter 1.7 Rating: 0 out of 5 stars0 ratingsPragmatic Microservices with C# and Azure: Build, deploy, and scale microservices efficiently to meet modern software demands Rating: 0 out of 5 stars0 ratingsBootstrap for ASP.NET MVC - Second Edition Rating: 0 out of 5 stars0 ratingsHands-On Kubernetes on Windows: Effectively orchestrate Windows container workloads using Kubernetes Rating: 0 out of 5 stars0 ratingsASP.NET Core 5 and Angular: Full-stack web development with .NET 5 and Angular 11 Rating: 0 out of 5 stars0 ratingsHands-On Enterprise Application Development with Python: Design data-intensive Application with Python 3 Rating: 0 out of 5 stars0 ratings
Databases For You
Oracle DBA Mentor: Succeeding as an Oracle Database Administrator Rating: 0 out of 5 stars0 ratingsBlockchain Basics: A Non-Technical Introduction in 25 Steps Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Beginning Microsoft Power BI: A Practical Guide to Self-Service Data Analytics Rating: 0 out of 5 stars0 ratingsAccess 2019 For Dummies Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsPractical Data Analysis Rating: 4 out of 5 stars4/5CompTIA DataSys+ Study Guide: Exam DS0-001 Rating: 0 out of 5 stars0 ratingsBehind Every Good Decision: How Anyone Can Use Business Analytics to Turn Data into Profitable Insight Rating: 5 out of 5 stars5/5Python Projects for Everyone Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Access 2016 For Dummies Rating: 0 out of 5 stars0 ratingsGo in Action Rating: 5 out of 5 stars5/5The Analytic Detective: Decipher Your Company’s Data Clues and Become Irreplaceable Rating: 0 out of 5 stars0 ratingsAccess for Beginners: Access Essentials, #1 Rating: 0 out of 5 stars0 ratingsLearn SQL Server Administration in a Month of Lunches Rating: 3 out of 5 stars3/5Learning Oracle 12c: A PL/SQL Approach Rating: 0 out of 5 stars0 ratingsAccess 2010 All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn Git in a Month of Lunches Rating: 0 out of 5 stars0 ratingsAzure SQL Revealed: A Guide to the Cloud for SQL Server Professionals Rating: 0 out of 5 stars0 ratingsA Concise Guide to Object Orientated Programming Rating: 0 out of 5 stars0 ratingsGetting Started with SQL Server 2014 Administration Rating: 0 out of 5 stars0 ratingsPython and SQLite Development Rating: 0 out of 5 stars0 ratingsPractical SQL Rating: 4 out of 5 stars4/5SQL in 30 Pages Rating: 4 out of 5 stars4/5Learning PostgreSQL Rating: 1 out of 5 stars1/5
Reviews for Learning Azure DocumentDB
0 ratings0 reviews
Book preview
Learning Azure DocumentDB - Becker Riccardo
Table of Contents
Learning Azure DocumentDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Instant updates on new Packt books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with DocumentDB
What is DocumentDB?
The characteristics of a schema
Having JavaScript at the core
Indexing a document
DocumentDB as a service
Understanding performance
Handling transactions
Common use cases
Building the Internet of Things
Storing user profile information
Logging information
Building mobile solutions
Exploring the data model
DocumentDB account
Creating databases
Administering users
Setting permissions
Managing collections
DocumentDB versus other databases
Azure Table storage
MongoDB
Comparison chart
Understanding the price model
Account charges
Number of collections
Request Units
Understanding storage
Expanding resources
Building your first application
Provisioning an account
Creating a database
Creating a collection
Building a console application
Setting up a solution
Saving a document
Summary
2. Setting up and Managing Your Database
Managing your keys
Recycling keys
Managing read-only keys
Using resource tokens
Creating resource tokens
Creating a collection
Creating a user and its permission
Creating a document with permissions
Creating a document without permissions
Listing permissions
Setting consistency levels
Managing alerts
Monitoring your account
Creating alerts
Summary
3. Basic Querying
Creating resources
Creating a collection
Creating a document
Using DocumentDB SQL
Using LINQ to object
Using LINQ
Updating the PersonInformation
Reading resources
Reading documents
Using the WHERE clause
Using a simple JOIN
Updating documents
Updating documents
Deleting documents
Summary
4. Advanced Querying
Using the SELECT statement
Selecting some documents
Using the FROM clause
Aliasing
Joining documents
Selecting from subdocuments
Using the WHERE clause
Binary operators
The BETWEEN keyword
Logical operators
Using the IN keyword
Conditional expressions
Using built-in functions
Building stored procedures
Building triggers
Building user-defined functions
Using LINQ to DocumentDB
Summary
5. Using REST to Access Your Database
Understanding the basics of REST
Using the GET verb
Using the POST verb
Using the PUT verb
Using the DELETE verb
Querying DocumentDB resources
Setting request headers
Generating the authorization header
Getting all databases
Adding a document
Summary
6. Using Node.js to Access Your Database
Introducing Node.js
What is Node.js?
Why use Node.js?
Preparing Visual Studio 2015
Building our first Node.js application
Creating our first app
Creating a web app
Utilizing DocumentDB from Node.js
Preparing our project
Connecting to DocumentDB
Creating a module
Creating and finding a document
Summary
7. Advanced Techniques
Introducing indexes
Explaining default indexing
Customizing indexing policies
Configuring index update mode
Consistent indexing mode
Lazy indexing mode
None indexing mode
Setting index precisions
Manipulating paths in indexes
Setting different index types
Configuring index paths
Setting the index precision
Partitioning data
Using hash partitioning
Using range partitioning
Managing performance
Using transactions
Setting consistency levels
Using strong consistency
Using bounded staleness consistency
Using session consistency
Using eventual staleness consistency
Summary
8. Putting Your Database at the Heart of Azure Solutions
Introducing an Internet of Things scenario
IoT Inc.
Technical requirements
Designing the model
Building a custom partition resolver
Building the Web API
Registering a device
Increasing search capabilities
Setting up Azure Search
Enhancing security
Creating and configuring Key Vault
Using Key Vault from ASP.NET
Encrypting sensitive data
Migrating data
Summary
Index
Learning Azure DocumentDB
Learning Azure DocumentDB
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2015
Production reference: 1161115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-246-7
www.packtpub.com
Credits
Author
Riccardo Becker
Reviewers
Rémon ter Haar
Juan Carlos Sánchez
Commissioning Editor
Neil Alexander
Acquisition Editor
Kirk D'costa
Content Development Editor
Samantha Gonsalves
Technical Editor
Madhunikita Sunil Chindarkar
Copy Editor
Roshni Banerjee
Project Coordinator
Sanchita Mandal
Proofreader
Safis Editing
Indexer
Priya Sane
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur
About the Author
Riccardo Becker works full time as a principal IT architect for CGI in the Netherlands. He holds several certifications and his background in computing goes way back to 1998, when he started working with good old Visual Basic 5.0 (or was it 6.0?). Ever since, he has fulfilled several roles, such as a developer, lead developer, architect, project leader, practice manager. Recently, he decided to accept the role of a principal IT architect where he focuses on innovation, cutting-edge technology, and specifically on Microsoft Azure, the Internet of Things, and cloud computing in general.
In 2007, he joined the Microsoft LEAP program where he got a peek at the move Microsoft was about to make on their road to the cloud. Pat Helland gave him that insight, and since the first release of Microsoft Azure on PDC 2008, he started to focus on it, keeping track of the progress and the maturity of the platform. In the past few years, he has also done a lot of work on incubation with his employer, raising awareness of cloud computing in general and Microsoft Azure in particular.
I would like to thank all my colleagues who have helped me on various subjects inside the world of Azure. Special thanks go to Rémon ter Haar and Juan Carlos Sánchez who were patient enough to review my chapters. Thanks Rémon and Juan!
I would also like to thank the folks from Packt Publishing who helped me stay on track and on schedule despite some bummers and some changes that I made to the original outline.
Special thanks to my employer CGI for giving me all the opportunities and interesting projects that have helped me in realizing this book. Thanks to my daily job and the ability to focus on the subjects, I have come to the point of having enough knowledge to write this book.
This is my second published book, since I have already published Windows Azure Programming Patterns for Start-ups, also with the help of Packt Publishing.
About the Reviewers
Rémon ter Haar is highly experienced in designing and implementing Microsoft technology-based solutions. He has worked as a technical solution architect and lead developer in various projects. For the last 8 years, he has been specializing as a system integrator using Microsoft BizTalk technology and Microsoft Azure. He currently works at Motion10 (www.motion10.nl) as a BizTalk consultant. Motion10 is the leading competence center in the Netherlands when it comes to system integration, SharePoint, Office 365, BI, and Internet of Things.
He has also reviewed Windows Azure Programming Patterns for Start-ups.
Juan Carlos Sánchez is a software engineer and he writes code for fun. He loves to work in teams and is familiar with the SCRUM process and Agile Release Train.
He has experience of the following applications:
Desktop windows applications (WPF)
Cross-platform phone applications (Cordova and Ionic)
Azure: Cloud services, Active Directory, and web applications (AngularJS)
Databases: Entity Framework SQL Server, DocumentDB, and Azure Storage
He contributes to the community with his blog and code at the following links:
http://www.softwarejuancarlos.com
http://github.com/softwarejc
To my family and girlfriend—I love you.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
Support files, eBooks, discount offers, and morehttps://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book