SlideShare ist ein Scribd-Unternehmen logo
1 von 30
ww.aditi.com
G SARAVANAN
www.aditi.com
ww.aditi.com
Orchestrated by…
www.aditi.com
ww.aditi.com
Azure Document DB?
• NoSQL document database service designed for modern mobile and web applications
• Provides fast read and write
• Easily scale up and down on demand
• JavaScript integration
• Schema less database
• Enables complex ad hoc queries using SQL language
• Multi-Document transaction processing using Stored Procedure, triggers & UDFs
• Natively supports JSON documents
3
ww.aditi.com
Where does it fits?
4
ww.aditi.com
Resource Model
5
ww.aditi.com
Resource Description
Database account A database account is associated with a set of databases and a fixed amount of blob storage for attachments (preview feature). You can
create one or more database accounts using your Azure subscription. Every Standard database account is allocated a minimum capacity of
one S1 collection. For more information, visit our pricing page.
Database A database is a logical container of document storage partitioned across collections. It is also a users container.
User The logical namespace for scoping/partitioning permissions.
Permission An authorization token associated with a user for authorized access to a specific resource.
Collection A collection is a container of JSON documents and the associated JavaScript application logic. A collection is a billable entity, where the
cost is determined by the performance level associated with the collection. The performance levels (S1, S2 and S3) provide 10GB of
storage and a fixed amount of throughput. For more information on performance levels, visit our performance page.
Stored Procedure Application logic written in JavaScript which is registered with a collection and transactionally executed within the database engine.
Trigger Application logic written in JavaScript modeling side effects associated with insert, replace or delete operations.
UDF A side effect free, application logic written in JavaScript. UDFs enable you to model a custom query operator and thereby extend the core
DocumentDB query language.
Document User defined (arbitrary) JSON content. By default, no schema needs to be defined nor do secondary indices need to be provided for all the
documents added to a collection.
Attachment An attachment is a special document containing references and associated metadata for external blob/media. The developer can choose
to have the blob managed by DocumentDB or store it with an external blob service provider such as OneDrive, Dropbox, etc.
ww.aditi.com
Addressing a resource
Value of the _self Description
/dbs Feed of databases under a database account.
/dbs/{_rid-db} Database with the unique id property with the value {_rid-db}.
/dbs/{_rid-db}/colls/ Feed of collections under a database.
/dbs/{_rid-db}/colls/{_rid-coll} Collection with the unique id property with the value {_rid-coll}.
/dbs/{_rid-db}/users/ Feed of users under a database.
/dbs/{_rid-db}/users/{_rid-user} User with the unique id property with the value {_rid-user}.
/dbs/{_rid-db}/users/{_rid-user}/permissions Feed of permissions under a database.
/dbs/{_rid-db}/users/{_rid-user}/permissions/{_rid-permission} Permission with the unique id property with the value {_rid-permission}.
7
ww.aditi.com
Document DB logical view
8
ww.aditi.com
Relational View – Document Data View
9
ww.aditi.com
Modeling Data in Document DB
• Embedding data
10
When to embed
In general, use embedded data models when:
• There are contains relationships between entities.
• There are one-to-few relationships between entities.
• There is embedded data that changes infrequently.
• There is embedded data won't grow without bound.
ww.aditi.com
• Referencing data
11
When to reference
In general, use normalized data models when:
• Representing one-to-many relationships.
• Representing many-to-many relationships.
• Related data changes frequently.
• Referenced data could be unbounded.
ww.aditi.com
• Hybrid data (Combination of embed & referencing)
12
Detail Info: https://azure.microsoft.com/en-in/documentation/articles/documentdb-modeling-data/
ww.aditi.com
Indexing
13
• Specified at the collection level
• Automatic indexing
– By default, all documents are automatically indexed, but you can choose to turn it off.
– When indexing is turned off, documents can be accessed only through their self-links or by queries using ID.
ww.aditi.com 14
• Indexing mode
– Consistent – By default indexes synchronously updated on insert, replace or delete
– Lazy – asynchronous index update (targeted at bulk ingestion)
ww.aditi.com 15
• Indexing Types
 Hash – supports efficient equality and JOIN queries
 Range – supports efficient equality queries, range queries (using >, <, >=, <=, !=), and Order By queries
Hash:
SELECT * FROM collection c WHERE c.prop = "value
SELECT tag FROM collection c JOIN tag IN c.props WHERE tag = 5
Range:
SELECT * FROM collection c WHERE c.prop = "value“
SELECT * FROM collection c WHERE c.prop > 5
SELECT * FROM collection c ORDER BY c.prop
Note: Range indexes are supported only for numeric values.
ww.aditi.com
Indexing logical View
16
Example:
JSON property: {"headquarters": "Belgium"}
Corresponds to the path: /"headquarters"/"Belgium".
JSON array: {"exports": [{"city": “Moscow"}, {"city": Athens"}]}
Correspond to the paths: /"exports"/0/"city"/"Moscow" and /"exports"/1/"city"/"Athens".
ww.aditi.com
Consistency levels
The choice of consistency level has performance implications for both write and read operations. It applies to all the collections in
the database (future there is a plan of overriding the consistency level per collection basics)
• Strong
– provides absolute guarantees on data consistency, but offers the lowest level of read and write performance.
• Bounded staleness
– provides more predictable behavior for read consistency while offering the lowest latency writes
• Session
– provides predictable read data consistency for a session while offering the lowest latency writes
• Eventual
– provides the weakest read consistency but offers the lowest latency for both reads and writes.
17
ww.aditi.com
Securing access
• Account administrator
– Full access to all of the resources (administrative and application) within a given DocumentDB account.
• Read-only administrator
– Read-only access to all of the resources (administrative and application within a given DocumentDB account.
• Database user:
– The DocumentDB user resource associated with a specific set of DocumentDB database resources (e.g. collections, documents,
scripts).
18
Administrative resources
• Account
• Database
• User
• Permission
Application resources
• Collection
• Document
• Attachment
• Stored procedure
• Trigger
• User-defined function
ww.aditi.com
Create User & Permission
19
ww.aditi.com
Stored Procedure
20
Creating, registering and executing the sample hello world stored procedure
ww.aditi.com
Triggers (Pre – Trigger)
21
Validating the properties of a document that is being created
ww.aditi.com
UDF’s
22
Creates a UDF to calculate income tax based on rates for various income brackets, and then uses it inside a query to find all people who paid
more than $20,000 in taxes.
ww.aditi.com
DocumentDB Queries
23
http://www.documentdb.com/sql/demo
ww.aditi.com
Pricing
24
ww.aditi.com
Libraries
25
• .NET API
• Node.js
• Java
• JavaScript
• Python
ww.aditi.com
Limits and quotas
26
ENTITY QUOTA (STANDARD OFFER)
Database Accounts* 5
Number of databases per database account 100
Number of users per database account – across all databases 500,000
Number of permissions per database account – across all databases 2,000,000
Attachment storage per database account (Preview Feature) 2 GB
Maximum Request Units / second per collection 2500
Number of stored procedures, triggers and UDFs per collection* 25 each
Maximum execution time for stored procedure and trigger 5 seconds
Provisioned document storage / collection 10 GB
Maximum collections per database account* 100
Maximum document storage per database (100 collections)* 1 TB
Maximum Length of the Id property 255 characters
Maximum items per page 1000
ww.aditi.com 27
ENTITY QUOTA (STANDARD OFFER)
Maximum request size of document and attachment 512KB
Maximum request size of stored procedure, trigger and UDF 512KB
Maximum response size 1MB
String All strings must conform to the UTF-8 encoding. Since UTF-8 is a variable width encoding, string
sizes are determined using the UTF-8 bytes.
Maximum length of property or value No practical limit
Maximum number of UDFs per query* 1
Maximum number of built-in functions per query No practical limit
Maximum number of JOINs per query* 2
Maximum number of AND clauses per query* 5
Maximum number of OR clauses per query* 5
Maximum number of values per IN expression* 100
Maximum number of collection creates per minute* 5
Maximum number of scale operations per minute* 5
ww.aditi.com
Demo
28
ww.aditi.com
THANK YOU
www.aditi.com
ww.aditi.com
Web | Blog | Facebook | Twitter | LinkedIn
www.aditi.com

Weitere ähnliche Inhalte

Was ist angesagt?

Engineering practices in big data storage and processing
Engineering practices in big data storage and processingEngineering practices in big data storage and processing
Engineering practices in big data storage and processingSchubert Zhang
 
Prepare for Peak Holiday Season with MongoDB
Prepare for Peak Holiday Season with MongoDBPrepare for Peak Holiday Season with MongoDB
Prepare for Peak Holiday Season with MongoDBMongoDB
 
Performance Benchmarking of Key-Value Store NoSQL Databases
Performance Benchmarking of Key-Value Store NoSQL Databases Performance Benchmarking of Key-Value Store NoSQL Databases
Performance Benchmarking of Key-Value Store NoSQL Databases IJECEIAES
 
An Intro to NoSQL Databases
An Intro to NoSQL DatabasesAn Intro to NoSQL Databases
An Intro to NoSQL DatabasesRajith Pemabandu
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Databasenehabsairam
 
Data Virtualization in the Cloud: Accelerating Data Virtualization Adoption
Data Virtualization in the Cloud: Accelerating Data Virtualization AdoptionData Virtualization in the Cloud: Accelerating Data Virtualization Adoption
Data Virtualization in the Cloud: Accelerating Data Virtualization AdoptionDenodo
 
9. Document Oriented Databases
9. Document Oriented Databases9. Document Oriented Databases
9. Document Oriented DatabasesFabio Fumarola
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBaseSindhujanDhayalan
 
JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017Luigi Fugaro
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewNorberto Leite
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational DatabasesChris Baglieri
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsnehabsairam
 
NoSQL and MapReduce
NoSQL and MapReduceNoSQL and MapReduce
NoSQL and MapReduceJ Singh
 
Jumpstart: MongoDB BI Connector & Tableau
Jumpstart: MongoDB BI Connector & TableauJumpstart: MongoDB BI Connector & Tableau
Jumpstart: MongoDB BI Connector & TableauMongoDB
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBIke Ellis
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBAn Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBMongoDB
 

Was ist angesagt? (20)

Horizon for Big Data
Horizon for Big DataHorizon for Big Data
Horizon for Big Data
 
Engineering practices in big data storage and processing
Engineering practices in big data storage and processingEngineering practices in big data storage and processing
Engineering practices in big data storage and processing
 
Prepare for Peak Holiday Season with MongoDB
Prepare for Peak Holiday Season with MongoDBPrepare for Peak Holiday Season with MongoDB
Prepare for Peak Holiday Season with MongoDB
 
Performance Benchmarking of Key-Value Store NoSQL Databases
Performance Benchmarking of Key-Value Store NoSQL Databases Performance Benchmarking of Key-Value Store NoSQL Databases
Performance Benchmarking of Key-Value Store NoSQL Databases
 
An Intro to NoSQL Databases
An Intro to NoSQL DatabasesAn Intro to NoSQL Databases
An Intro to NoSQL Databases
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
Document Database
Document DatabaseDocument Database
Document Database
 
Data Virtualization in the Cloud: Accelerating Data Virtualization Adoption
Data Virtualization in the Cloud: Accelerating Data Virtualization AdoptionData Virtualization in the Cloud: Accelerating Data Virtualization Adoption
Data Virtualization in the Cloud: Accelerating Data Virtualization Adoption
 
9. Document Oriented Databases
9. Document Oriented Databases9. Document Oriented Databases
9. Document Oriented Databases
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBase
 
JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017JDV for Codemotion Rome 2017
JDV for Codemotion Rome 2017
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature Preview
 
Mongo db
Mongo dbMongo db
Mongo db
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortals
 
NoSQL and MapReduce
NoSQL and MapReduceNoSQL and MapReduce
NoSQL and MapReduce
 
Hdfs Dhruba
Hdfs DhrubaHdfs Dhruba
Hdfs Dhruba
 
Jumpstart: MongoDB BI Connector & Tableau
Jumpstart: MongoDB BI Connector & TableauJumpstart: MongoDB BI Connector & Tableau
Jumpstart: MongoDB BI Connector & Tableau
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBAn Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDB
 

Ähnlich wie AzureDocumentDB

Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL AzureShy Engelberg
 
Azure document db/Cosmos DB
Azure document db/Cosmos DBAzure document db/Cosmos DB
Azure document db/Cosmos DBMohit Chhabra
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBRadenko Zec
 
Slide Storage.pptx
Slide Storage.pptxSlide Storage.pptx
Slide Storage.pptxAseem Goyal
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudipasalapudi123
 
DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015Vidyasagar Machupalli
 
Cosmos DB Real-time Advanced Analytics Workshop
Cosmos DB Real-time Advanced Analytics WorkshopCosmos DB Real-time Advanced Analytics Workshop
Cosmos DB Real-time Advanced Analytics WorkshopDatabricks
 
Accesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformAccesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformLuca Di Fino
 
Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage CCG
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101Ike Ellis
 
Prague data management meetup 2018-03-27
Prague data management meetup 2018-03-27Prague data management meetup 2018-03-27
Prague data management meetup 2018-03-27Martin Bém
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE
 
Afternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesAfternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesCCG
 
OpenProdoc Overview
OpenProdoc OverviewOpenProdoc Overview
OpenProdoc Overviewjhierrot
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platformgiventocode
 

Ähnlich wie AzureDocumentDB (20)

Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
Azure Data Storage
Azure Data StorageAzure Data Storage
Azure Data Storage
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL Azure
 
Azure document db/Cosmos DB
Azure document db/Cosmos DBAzure document db/Cosmos DB
Azure document db/Cosmos DB
 
Mini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure StorageMini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure Storage
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
Slide Storage.pptx
Slide Storage.pptxSlide Storage.pptx
Slide Storage.pptx
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudi
 
DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015
 
Cosmos DB Real-time Advanced Analytics Workshop
Cosmos DB Real-time Advanced Analytics WorkshopCosmos DB Real-time Advanced Analytics Workshop
Cosmos DB Real-time Advanced Analytics Workshop
 
Accesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data PlatformAccesso ai dati con Azure Data Platform
Accesso ai dati con Azure Data Platform
 
Presentation day1oracle 12c
Presentation day1oracle 12cPresentation day1oracle 12c
Presentation day1oracle 12c
 
Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage Data Analytics Meetup: Introduction to Azure Data Lake Storage
Data Analytics Meetup: Introduction to Azure Data Lake Storage
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Prague data management meetup 2018-03-27
Prague data management meetup 2018-03-27Prague data management meetup 2018-03-27
Prague data management meetup 2018-03-27
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
 
Afternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesAfternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data Services
 
OpenProdoc Overview
OpenProdoc OverviewOpenProdoc Overview
OpenProdoc Overview
 
Azure - Data Platform
Azure - Data PlatformAzure - Data Platform
Azure - Data Platform
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 

Mehr von Saravanan G

Mehr von Saravanan G (7)

Wcat
WcatWcat
Wcat
 
ServiceFabric-Arch
ServiceFabric-ArchServiceFabric-Arch
ServiceFabric-Arch
 
Windows Azure Marketplace
Windows Azure MarketplaceWindows Azure Marketplace
Windows Azure Marketplace
 
PowerShell-2
PowerShell-2PowerShell-2
PowerShell-2
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
WindowsAzureIAAS
WindowsAzureIAASWindowsAzureIAAS
WindowsAzureIAAS
 
WindowsAzureSDK1.7
WindowsAzureSDK1.7WindowsAzureSDK1.7
WindowsAzureSDK1.7
 

AzureDocumentDB

  • 3. ww.aditi.com Azure Document DB? • NoSQL document database service designed for modern mobile and web applications • Provides fast read and write • Easily scale up and down on demand • JavaScript integration • Schema less database • Enables complex ad hoc queries using SQL language • Multi-Document transaction processing using Stored Procedure, triggers & UDFs • Natively supports JSON documents 3
  • 6. ww.aditi.com Resource Description Database account A database account is associated with a set of databases and a fixed amount of blob storage for attachments (preview feature). You can create one or more database accounts using your Azure subscription. Every Standard database account is allocated a minimum capacity of one S1 collection. For more information, visit our pricing page. Database A database is a logical container of document storage partitioned across collections. It is also a users container. User The logical namespace for scoping/partitioning permissions. Permission An authorization token associated with a user for authorized access to a specific resource. Collection A collection is a container of JSON documents and the associated JavaScript application logic. A collection is a billable entity, where the cost is determined by the performance level associated with the collection. The performance levels (S1, S2 and S3) provide 10GB of storage and a fixed amount of throughput. For more information on performance levels, visit our performance page. Stored Procedure Application logic written in JavaScript which is registered with a collection and transactionally executed within the database engine. Trigger Application logic written in JavaScript modeling side effects associated with insert, replace or delete operations. UDF A side effect free, application logic written in JavaScript. UDFs enable you to model a custom query operator and thereby extend the core DocumentDB query language. Document User defined (arbitrary) JSON content. By default, no schema needs to be defined nor do secondary indices need to be provided for all the documents added to a collection. Attachment An attachment is a special document containing references and associated metadata for external blob/media. The developer can choose to have the blob managed by DocumentDB or store it with an external blob service provider such as OneDrive, Dropbox, etc.
  • 7. ww.aditi.com Addressing a resource Value of the _self Description /dbs Feed of databases under a database account. /dbs/{_rid-db} Database with the unique id property with the value {_rid-db}. /dbs/{_rid-db}/colls/ Feed of collections under a database. /dbs/{_rid-db}/colls/{_rid-coll} Collection with the unique id property with the value {_rid-coll}. /dbs/{_rid-db}/users/ Feed of users under a database. /dbs/{_rid-db}/users/{_rid-user} User with the unique id property with the value {_rid-user}. /dbs/{_rid-db}/users/{_rid-user}/permissions Feed of permissions under a database. /dbs/{_rid-db}/users/{_rid-user}/permissions/{_rid-permission} Permission with the unique id property with the value {_rid-permission}. 7
  • 9. ww.aditi.com Relational View – Document Data View 9
  • 10. ww.aditi.com Modeling Data in Document DB • Embedding data 10 When to embed In general, use embedded data models when: • There are contains relationships between entities. • There are one-to-few relationships between entities. • There is embedded data that changes infrequently. • There is embedded data won't grow without bound.
  • 11. ww.aditi.com • Referencing data 11 When to reference In general, use normalized data models when: • Representing one-to-many relationships. • Representing many-to-many relationships. • Related data changes frequently. • Referenced data could be unbounded.
  • 12. ww.aditi.com • Hybrid data (Combination of embed & referencing) 12 Detail Info: https://azure.microsoft.com/en-in/documentation/articles/documentdb-modeling-data/
  • 13. ww.aditi.com Indexing 13 • Specified at the collection level • Automatic indexing – By default, all documents are automatically indexed, but you can choose to turn it off. – When indexing is turned off, documents can be accessed only through their self-links or by queries using ID.
  • 14. ww.aditi.com 14 • Indexing mode – Consistent – By default indexes synchronously updated on insert, replace or delete – Lazy – asynchronous index update (targeted at bulk ingestion)
  • 15. ww.aditi.com 15 • Indexing Types  Hash – supports efficient equality and JOIN queries  Range – supports efficient equality queries, range queries (using >, <, >=, <=, !=), and Order By queries Hash: SELECT * FROM collection c WHERE c.prop = "value SELECT tag FROM collection c JOIN tag IN c.props WHERE tag = 5 Range: SELECT * FROM collection c WHERE c.prop = "value“ SELECT * FROM collection c WHERE c.prop > 5 SELECT * FROM collection c ORDER BY c.prop Note: Range indexes are supported only for numeric values.
  • 16. ww.aditi.com Indexing logical View 16 Example: JSON property: {"headquarters": "Belgium"} Corresponds to the path: /"headquarters"/"Belgium". JSON array: {"exports": [{"city": “Moscow"}, {"city": Athens"}]} Correspond to the paths: /"exports"/0/"city"/"Moscow" and /"exports"/1/"city"/"Athens".
  • 17. ww.aditi.com Consistency levels The choice of consistency level has performance implications for both write and read operations. It applies to all the collections in the database (future there is a plan of overriding the consistency level per collection basics) • Strong – provides absolute guarantees on data consistency, but offers the lowest level of read and write performance. • Bounded staleness – provides more predictable behavior for read consistency while offering the lowest latency writes • Session – provides predictable read data consistency for a session while offering the lowest latency writes • Eventual – provides the weakest read consistency but offers the lowest latency for both reads and writes. 17
  • 18. ww.aditi.com Securing access • Account administrator – Full access to all of the resources (administrative and application) within a given DocumentDB account. • Read-only administrator – Read-only access to all of the resources (administrative and application within a given DocumentDB account. • Database user: – The DocumentDB user resource associated with a specific set of DocumentDB database resources (e.g. collections, documents, scripts). 18 Administrative resources • Account • Database • User • Permission Application resources • Collection • Document • Attachment • Stored procedure • Trigger • User-defined function
  • 19. ww.aditi.com Create User & Permission 19
  • 20. ww.aditi.com Stored Procedure 20 Creating, registering and executing the sample hello world stored procedure
  • 21. ww.aditi.com Triggers (Pre – Trigger) 21 Validating the properties of a document that is being created
  • 22. ww.aditi.com UDF’s 22 Creates a UDF to calculate income tax based on rates for various income brackets, and then uses it inside a query to find all people who paid more than $20,000 in taxes.
  • 25. ww.aditi.com Libraries 25 • .NET API • Node.js • Java • JavaScript • Python
  • 26. ww.aditi.com Limits and quotas 26 ENTITY QUOTA (STANDARD OFFER) Database Accounts* 5 Number of databases per database account 100 Number of users per database account – across all databases 500,000 Number of permissions per database account – across all databases 2,000,000 Attachment storage per database account (Preview Feature) 2 GB Maximum Request Units / second per collection 2500 Number of stored procedures, triggers and UDFs per collection* 25 each Maximum execution time for stored procedure and trigger 5 seconds Provisioned document storage / collection 10 GB Maximum collections per database account* 100 Maximum document storage per database (100 collections)* 1 TB Maximum Length of the Id property 255 characters Maximum items per page 1000
  • 27. ww.aditi.com 27 ENTITY QUOTA (STANDARD OFFER) Maximum request size of document and attachment 512KB Maximum request size of stored procedure, trigger and UDF 512KB Maximum response size 1MB String All strings must conform to the UTF-8 encoding. Since UTF-8 is a variable width encoding, string sizes are determined using the UTF-8 bytes. Maximum length of property or value No practical limit Maximum number of UDFs per query* 1 Maximum number of built-in functions per query No practical limit Maximum number of JOINs per query* 2 Maximum number of AND clauses per query* 5 Maximum number of OR clauses per query* 5 Maximum number of values per IN expression* 100 Maximum number of collection creates per minute* 5 Maximum number of scale operations per minute* 5
  • 30. ww.aditi.com Web | Blog | Facebook | Twitter | LinkedIn www.aditi.com