Learning Azure DocumentDB
eBook - ePub

Learning Azure DocumentDB

  1. 152 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Azure DocumentDB

About this book

Create outstanding enterprise solutions around DocumentDB using the latest technologies and programming tools with Azure

About This Book

  • Get to know the concepts of DocumentDB and learn to work your way around it
  • Manipulate and query your documents using different modern technologies to access DocumentDB
  • Build a real-life scenario using Microsoft Visual Studio and C# with this handy and practical guide

Who This Book Is For

This book is for novice developers and database architects who need a thorough knowledge of the features of DocumentDB and developing applications with it. Basic knowledge of SQL would be helpful.

What You Will Learn

  • Create, manage, and configure your DocumentDB environment
  • Execute SQL queries from simple to complex and nested ones against your database
  • Get to know about advanced DocumentDB techniques such as scopes, portioning, indexing, triggers, UDF's, and security
  • Fine-tune your DocumentDB database to optimize performance and costs
  • Interact with DocumentDB from different technologies and platforms
  • Build a real-life scenario using C# and put DocumentDB at the heart of Azure solutions
  • Understand how to migrate from your current datastore to DocumentDB

In Detail

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.

Style and approach

This book can be used as a tutorial where you learn step by step, but also as a knowledge base to quickly look up recipes you can instantly utilize. Starting with the basics and moving on to advanced topics, every concept is explained in theory and demonstrated through easy-to-understand examples.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Learning Azure DocumentDB


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

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.packt...

Table of contents

  1. Learning Azure DocumentDB

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learning Azure DocumentDB by Riccardo Becker in PDF and/or ePUB format, as well as other popular books in Computer Science & Databases. We have over one million books available in our catalogue for you to explore.