Introduction to Azure DocumentDB
-
Upload
radenko-zec -
Category
Technology
-
view
203 -
download
0
Transcript of Introduction to Azure DocumentDB
Agenda
• NoSQL• Introduction to Azure DocumentDB• Storing data • Querying data • Transactions over data
Is DocumentDB NoSQL database?
• database management system that is non relational
• schema less, avoids joins & easy to scale
• NoSQL =
DocumentDB at MSN.com
• over 425 million unique users• store 20TB of JSON document data• available globally to serve all markets• under 15ms writes and single digit ms reads
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 units
Interaction Model• RESTful interaction
over HTTP
• HTTP and TCP connectivity
Attachments
• Store large blobs/media outside core storage• Document DB managed– Submit raw content in POST– Document DB stores into Azure Blob storage
(2GB today)– Document DB manages lifecycle
Indexing in DocumentDB
• By default everything is indexed• Indexing is not a B-Tree (based on BWTree used in
Hackaton) and works really well under write pressure and at scale
Tunning indexesPOST https://<REST URI>/colls HTTP/1.1
...
Accept: application/json
{
"id":"customIndexCollection",
"indexingPolicy":{
"automatic":true,
"indexingMode":"Consistent",
"IncludedPaths":[
{
"IndexType":"Hash",
"Path":"/"
}
],
"ExcludedPaths":[
"/\"nonIndexedContent\"/*"
]
}
}
...
Indexing modes:• synchronous (Consistent) • asynchronous (Lazy)
Index types:• Hash• Range
Multi Document JavaScript Transactions
• Execution wrapped in an implicit transaction • Preregistered and scoped to a collection• Performed with ACID guarantees• If exceptions are thrown through the server side
execution of JavaScript application code, the entire transaction is rolled back.
Known limits
• Stored procedure 5 second execution timeout• Index policies can be specified only at collection creation
time• no aggregate functions for now, no datetime type• no joins between documents and collections• Maximum request size of document and attachment 512KB• Maximum response size - 1MB• Maximum Request Units / sec per collection 2000etc…