Author : MD TAREQ HASSAN | Updated : 2020/11/11
Architecture overview
- A database account manages one or more databases
- An Azure Cosmos DB database in-turn manages users, permissions and containers
- An Azure Cosmos DB container is a schema-agnostic container of arbitrary user-generated entities and stored procedures, triggers and user-defined-functions
- Entities under the customer’s database account (databases, users, permissions, containers etc.) are referred to as resources
- Each resource is uniquely identified by a stable and logical URI and represented as a JSON document
- When using document-oriented APIs
- container => projected as collection
- item => projected as document
The overall resource model of an application using Azure Cosmos DB is a hierarchical overlay of the resources rooted under the database account, and can be navigated using hyperlinks
[Image courtesy: Microsoft docs]
See: Understanding Cosmos DB coming from a relational world
Hierarchy
- Account (URI,
**.azure.com
, Access keys)- Database (1…*: one or more databases under an account)
- Container (0…*: each Database can containe zero to many containers)
- Item (each container hold one or more items)
- Container (0…*: each Database can containe zero to many containers)
- Database (1…*: one or more databases under an account)
Logial partition
All the data within an Azure Cosmos DB container (e.g. collection, table, graph etc.) is horizontally partitioned and transparently managed by resource partitions
[Image courtesy: Microsoft docs]
Physical partition
- Each logical partition is saved in one or more physical partition
- There is no one-one co-relation between physical and logical partition