user data store { "id": "azuredocumentdb", "servicetype": "data...

26

Upload: lambert-blair

Post on 22-Dec-2015

228 views

Category:

Documents


1 download

TRANSCRIPT

Select * from Azure DocumentDBJohn MacintyreDBI-B318

In this session

Introduction to Azure DocumentDBGetting started … your first database accountStoring data Querying data Transactions over data

DocumentDB at Microsoft

over 425 million unique usersstore 20TB of JSON document

data

under 15ms writes and single digit ms reads

store for 40+ app / device combinations

available globally to serve all marketsuser data store

Introducing DocumentDB

{ "id": "AzureDocumentDB", "servicetype": "Data Platform", "servicename": "Azure DocumentDB", "releasetype": "Preview", "public": true, "regions": [ { "name": "North Europe", "visible": true, "capacity": 230034 }, { "name": "West US", "visible": true, "capacity": 800034 }, { "name": "East US", "visible": false, "capacity": 1000034 } ]}

{ "id": "MS_125734", "name": "John Macintyre", "jobrole": "Program Manager", "companyname": "Microsoft", "photo": null, "bio": "John builds stuff at Microsoft.", "topicids": [ "MS_Azure_12", "MS_Azure_23", "MS_Azure_44" ], "sessonids": [ "MS_TEE_DBIB318", "MS_TEE_DBI212" ]}

designed, built and optimized for JSON

{ } JSON

schema-free and queryable

{ }SQL

multi-document transactions

JS

tunable and fast

scalable and fully managed

The Basics

Resource Model Entities addressable by logical

URI Partitioned for scale out Replicated for HA Entities represented as JSON Accounts scale out through

addition of capacity unitsInteraction Model RESTful interaction over HTTP HTTP and TCP connectivity Standard HTTP verbs and

semantics

Development .Net, Node, Python and JS

clients SQL for query expression, .Net

LINQ JavaScript for server-side app

logic

DocumentDB Account

{ }{ }

Databases

Users

Permissions

Collections Documents

101010

Attachments

JS

JS

JS

Stored Procedures

Triggers

User Defined Functionsyour

documents

here

DEMO - Getting Started

1. Collections != Tables2. De-normalize data where appropriate3. Tuning and Perf – ConnectionPolicy,

DocumentClient reuse, consistency levels

Getting Started Tips

Recipe for query over schema-free dataJSON documents

as treesconsistent, automatic indexing

relational and hierarchical SQL

SELECT location.city, LocalTax(location.revenue) AS Tax FROM location IN company.locations WHERE location.revenue > 100

JavaScript

extensibility

DEMO – Queries and Indexing

1. Consider query needs and index policies. Index policies are immutable (for now)

2. Understand query costs, limits and avoid scans

3. Pre-aggregate where possible

Query and Indexing Tips

JavaScript Transactions

Transactionally process multiple documents with application defined stored procedures and triggers

JavaScript as the procedural language Language integrated Execution wrapped in an implicit transaction Preregistered and scoped to a collection Performed with ACID guarantees Triggers invoked as pre or post operations

Stored

Procedures

Triggers

DEMO – JavaScript Transactions

1. Understand transaction costs, mind the 5sec rule – batched execution with continuation

2. Test with expected data volumes3. Strategy for versioning and code

management

JavaScript Transaction Tips

Recap

Use document collections to store heterogeneous application dataQuery for documents through C# LINQ provider or SQLDevelop and evaluate queries through portal.azure.comTune and improve query performance with index policiesProcess multiple JSON documents through JS transactions

Further topics to exploreData consistency options with DocumentDB - http://aka.ms/docdbtune Extending queries through UDFs - http://aka.ms/docdbudfs Scaling and performance - http://aka.ms/docdbscale

Build your first DocumentDB app today

Get Started …Sign up for DocumentDB at http://aka.ms/docdbstart Access and configure your account through http://portal.azure.comDownload an SDK http://aka.ms/docdbsdks, build a sample http://aka.ms/docdbsample

Give Feedback …Ask questions through the forum http://aka.ms/docdbforum Suggest an idea and vote up other ideas for DocumentDB http://aka.ms/docdbideas On twitter @documentdbmail me at [email protected] or on twitter @johnmacputs

27 Hands on Labs + 8 Instructor Led Labs in Hall 7

DBI Track resources

Free SQL Server 2014 Technical Overview e-book

microsoft.com/sqlserver and Amazon Kindle StoreFree online training at Microsoft Virtual Academy

microsoftvirtualacademy.com Try new Azure data services previews!Azure Machine Learning, DocumentDB, and Stream Analytics

Resources

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

Developer Network

http://developer.microsoft.com

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Please Complete An Evaluation FormYour input is important!TechEd Schedule Builder CommNet station or PC

TechEd Mobile appPhone or Tablet

QR code

Evaluate this session

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.