Understanding the Azure Document DB

Azure Document DB is a Document No SQL subset of CosmosDb, so if you’re not familiar with it, I request you to go through my following articles,

Azure DB is a subset of Azure DocumentDB and a schema-free database that combines rich and familiar SQL query capabilities with consistently low latencies on JSON-based data models, targeting solutions for web, mobile, gaming, and IoT. Since DocumentDB is schema-agnostic, this makes it extremely easy to adjust and adapt data models on the fly as business logic and application scenarios change.

With DocumentDB, you no longer have to deploy constant updates to the data tier and worry about managing schema and relationships. All content in DocumentDB is automatically indexed, which makes it possible to query data across entire structures at any time. The term “NoSQL” is more of a marketing buzzword, and actually means “no requirement for entity relationships and secondary indexing” in order to query information.

Since DocumentDB is a JSON-based storage mechanism, accessing and interacting with data can be accomplished through most standards-based interfaces, as well as robust toolsets and SDKs. Although native Universal Windows Platform support is not currently available, support for virtually any other development scenario is available. Deeper-level features are currently exposed via JavaScript, such as stored procedures, triggers, and user-defined functions (UDFs) making it easy for developers to write application logic that can be packaged and executed directly on database storage partitions.

Document

Terminologies related to DocumentDb

Terminologies

  1. Database: A database is a logical container of document storage partitioned across collections. It is also a user's container.
  2. User: The logical namespace for scoping permissions.
  3. Permission: An authorization token associated with a user for access to a specific resource.
  4. Collection: A collection is a container of JSON documents and the associated JavaScript application logic.
  5. Stored Procedure: Application logic written in JavaScript which is registered with a collection and transactionally executed within the database engine.
  6. Trigger: Application logic written in JavaScript executed before or after either an insert, replace or delete operation.
  7. UDF: Application logic written in JavaScript. UDFs enable you to model a custom query operator and thereby extend the core DocumentDB query language.
  8. Document: Arbitrary user-defined 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.
  9. Hands-On Demo: We are trying to create an MVC application and showcase the simple CRUD operations with Cosmos DB.

Summary

Azure DocumentDB is a fully managed NoSQL document-based “database as a service” built for ultra-fast and predictable performance, high availability, elastic scaling, and global distribution, and is especially focused on ease of development.

The hierarchy of the Azure DocumentDB is as follows - Account-> Database -> Collection -> Document -> Attachments.

We have gone through the demo where we tried to do the basic CRUD operations in DocumentDB.