API for NoSQL
- New applications storing JSON documents
- The native API with the widest feature set
- SQL-like queries, change feed and hierarchical keys
In Azure Cosmos DB, one decision sets both query speed and the request unit bill: the partition key. Agnotic Technologies models containers from your real access patterns, then sets the partition key, consistency level, indexing policy and capacity mode so cost follows real use.
Trusted by global innovators
























Cosmos DB consulting
Azure Cosmos DB consulting is modeling and tuning Cosmos DB containers around how your application reads and writes. Agnotic Technologies chooses the API, picks a partition key from real access patterns, sizes request units and the capacity mode, sets the consistency level and indexing policy, and designs change feed processing and multi-region writes.
We design new containers and fix existing ones that rate limit, cost more than expected or cannot serve a new feature with their current key.
If your team runs on AWS instead, our Amazon DynamoDB consulting applies the same access-pattern-first method to that service.
API choice
An account is created for one API, so we settle this before any modeling starts.
Partition key
Every item lives in a logical partition named by its key, and every query and write is cheaper when it stays inside one.
Each read and write the application makes, with expected volume. Point reads by ID and partition key are the cheapest operation, so we design for as many as we can.
User ID, tenant ID or device ID usually beat status or date, which pile traffic onto a few partitions.
One key value can hold only a limited amount of data, so a key that grows without bound, such as a very large tenant, needs a second level.
Hierarchical partition keys, such as tenant, then user, then session, spread a large tenant while queries for one tenant still reach a small set of partitions.
We load realistic data, including your largest tenants, and read request unit charges and rate limiting per partition before launch.
Consistency
Stronger levels cost more per read and add latency across regions, so we pick a default for the account and override it per request where a workload needs something different.
Example: An account balance that must never read a stale value
Approach: Reads always return the latest committed write. Used with a single write region, where write latency grows with the distance between regions.
Example: Stock levels shown in several regions that may lag by a known amount
Approach: Reads lag by no more than a set number of versions or a time interval, whichever is reached first.
Example: A user who must see their own profile edits straight away
Approach: The most widely used level: each client session reads its own writes, with read throughput close to eventual.
Example: An activity feed where order matters but a short delay is fine
Approach: Reads never see writes out of order, though they may be behind.
Example: Like counts or view totals
Approach: No ordering guarantee and the lowest read cost, for data where a slightly stale value does no harm.
Request unit troubleshooting
The table we work through when a container rate limits or its bill climbs.
| Symptom | Likely cause | Fix |
|---|---|---|
| Requests fail with status 429 at busy times | Throughput is too low for the peak, or the traffic lands on one partition | Find any hot partition first; then raise throughput, switch to autoscale or change the key |
| One logical partition takes most of the requests | A low-cardinality key such as status or country, or one very large tenant | Move to a key with more distinct values, or to a hierarchical partition key |
| Queries cost far more than point reads | Queries without the partition key fan out across every physical partition | Filter on the partition key, or keep a copy of the data keyed for that query |
| Writes cost more than expected | The default indexing policy indexes every property of every item | Exclude paths that are never filtered or sorted, and add composite indexes only for real ORDER BY patterns |
| Change feed consumers fall behind | Too few processor instances, or slow work done inside the handler | Scale out processor instances, keep the handler small and push slow work to a queue |
| Large items read just to show a few fields | Arrays inside items keep growing as data is appended | Split growing arrays into separate items under the same partition key |
Every fix is checked against the request charge returned with each response, so the saving is measured, not assumed.
Events and regions
The features that shape the rest of the system around Cosmos DB.
Tenant-scoped partition keys, with hierarchical keys for the few tenants that grow large.
Profiles, carts and preferences read close to the user in several Azure regions.
Readings keyed by device, with TTL removing old data without a cleanup job.
The change feed drives projections and integrations from one source of truth.
Azure Cosmos DB for startups often starts in serverless mode, paying for request units used, with provisioned or autoscale throughput once traffic is steady.
References
Limits and behaviors from Microsoft Learn that decide the keys, capacity and pipelines we design.
Azure Cosmos DB offers five consistency levels, from strongest to weakest: strong, bounded staleness, session, consistent prefix and eventual. For the same request units, read throughput at strong and bounded staleness is half that of the other three.
Source: Microsoft Learn: consistency levels in Azure Cosmos DBEach logical partition in an Azure Cosmos DB container can store up to 20 GB of data, and there is no limit to the number of logical partitions in a container.
Source: Microsoft Learn: partitioning and horizontal scaling in Azure Cosmos DBAzure Cosmos DB measures every write, point read and query in request units; reading a single item of about 1 KB by its ID and partition key uses one request unit.
Source: Microsoft Learn: request units in Azure Cosmos DBThe Azure Cosmos DB change feed is a persistent record of changes to a container in the order they occur; delete operations and TTL expirations appear only in all versions and deletes mode.
Source: Microsoft Learn: change feed in Azure Cosmos DBHierarchical partition keys let an Azure Cosmos DB container use up to three levels of partition key, so a single top-level value such as one tenant can grow past 20 GB.
Source: Microsoft Learn: hierarchical partition keys in Azure Cosmos DBWe read your access patterns, containers, request unit metrics and 429 counts, and list what drives cost or blocks new features.
ModelNew partition keys, indexing policy and consistency settings, with data copied to a new container and a switch the application controls.
MoveThroughput limits, alerts on rate limiting and hot partitions, and a runbook your team can follow.
Operate