When deploying your service to Microsoft Azure, you have a number of options in terms of noSQL: you can install databases on Linux or Windows virtual machines by yourself, or via the marketplace, or you can use open source databases available as a service like HBase or proprietary and managed databases like Document DB. After showing these options, we'll show Document DB in more details. This is a noSQL database as a service that stores JSON.
3. Other related managed services (PaaS)
Azure Search
Redis Cache
HDInsight : Hive + ORC Hadoop with Column
storage + SQL
SQL Database Elastic Scale Relational + Sharding
Managed databases (PaaS)
Azure Storage Tables Clef/valeur
HDInsight HBase Column
DocumentDB Document JSON
IaaS
MongoDB Document
In IaaS, or managed by MongoLabs,
or MongoDB
Cassandra Column
In IaaS, may be initiated thru the
Marketplace
Titan Graph
… Any database that installs on
Windows or Linux
12. 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 units
{ }
{ }
JS
JS
JS
15. Query arbitrary paths,
properties and values
No secondary index
definitions required
Consistent Query Results in
the face of heavy writes
Query through SQL (or LINQ
in .NET)
JavaScript UDFs Extensibility
-- Nested lookup against index
SELECT B.Author
FROM Books B
WHERE B.Author.Name = "Leo Tolstoy"
-- Transformation, Filters, Array access
SELECT { Name: B.Title, Author: B.Author.Name }
FROM Books B
WHERE B.Price > 10 AND B.Language[0] = "English"
-- Joins, User Defined Functions (UDF)
SELECT CalculateRegionalTax(B.Price, "USA", "WA")
FROM Books B
JOIN L IN B.Languages
WHERE L.Language = "Russian"
16. The choice of consistency level has performance implications
for both write and read operations
• Write operations
• Consistency level changes impact request latency
• Stronger consistency levels result in higher write
latencies
• Read operations
• Consistency level changes impact throughput
• Weaker consistency levels result in higher read
throughput
Tip: You can lower the consistency level of a specific read or query
request by specifying [x-ms-consistency-level] request header or by
using RequestOptions in the SDKs
Document myDoc = await
client.ReadDocumentAsync(documentLink,
new RequestOptions
{ ConsistencyLevel = ConsistencyLevel.Eventual });
Lower consistency level on read operation
17. How it works
Automatic indexing of documents
JSON documents are represented as
trees
Structural information and instance
values are normalized into a JSON-Path
Example
{"headquarters": "Belgium"} /"headquarters"/"Belgium"
{"exports": [{"city": “Moscow"}, {"city": Athens"}]} /"exports"/0/"city"/"Moscow"
and /"exports"/1/"city"/"Athens".
18. Configuration Level Options
Automatic Per collection True (default) or False
Override with each document write
Indexing Mode Per collection Consistent or Lazy
Lazy for eventual updates/bulk ingestion
Included and excluded
paths
Per path Individual path or recursive includes (? And *)
Indexing Type Per path Support Hash (Default) and Range
Hash for equality, range for range queries
Indexing Precision Per path Supports 3 – 7 per path
Tradeoff storage, query RUs and write RUs
19. Path Description/use case
/ Default path for collection. Recursive and applies to whole document tree.
/"prop"/? Serve queries like the following (with Hash or Range types respectively):
SELECT * FROM collection c WHERE c.prop = "value"
SELECT * FROM collection c WHERE c.prop > 5
/"prop"/* All paths under the specified label.
/"prop"/"subprop"/ Used during query execution to prune documents that do not have the
specified path.
/"prop"/"subprop"/? Serve queries (with Hash or Range types respectively):
SELECT * FROM collection c WHERE c.prop.subprop = "value"
SELECT * FROM collection c WHERE c.prop.subprop > 5
20. 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
21.
22.
23. Get started with Azure DocumentDB
http://aka.ms/documentdb
DocumentDB Documentation, Videos & Tutorials
http://aka.ms/documentdbdocs
Submit DocumentDB Feedback & Vote for Features
http://aka.ms/documentdbfeedback
Sample Code
http://aka.ms/documentdbsamples
Team Blog
http://aka.ms/documentdbblog
DocumentDB Resources
49. tech.days 2015#mstechdays
Activez vos bénéfices Azure jusqu’à
115€ de ressources mensuelles
offertes
115€ /mois
x5 membres
x3 ans
= 4 175€ de ressources offertes
http://azure.com http://aka.ms/azurepourmsdn
150€ de ressources offertes
Sans engagement
Pour tous
Un mois d’essai offert
http://www.microsoft.com/bizspark/
Pour les startups
Bizspark
= 49 000€ de ressources offertes
pendant un an
Pour les abonnés
MSDN
50. tech.days 2015#mstechdays
Inscrivez-vous : http://aka.ms/pepiniereazure
Coaching technique et business
Ressources
Une équipe à Microsoft pour vous accompagner dans votre projet cloud et mettre à
votre disposition de l’aide personnalisée.
Visibilité