What Is Azure Cosmos DB? A Parcel Tracker Explains Partition Keys and RUs

Azure Cosmos DB is a managed distributed database service. In Azure Cosmos DB for NoSQL, an application stores JSON items in containers. Azure distributes the data using a partition key you choose. That choice determines which requests can go straight to the relevant data and which need to search more broadly.
Consider a parcel tracker. A customer wants the latest scan, support wants the full history, and a depot manager wants every late parcel in the building. All three are looking at the same business, but they give the database very different information.
Table of Contents
Model the request a customer actually makes
Create an events container with /parcelId as its partition key. An example item has {"id":"scan-03","parcelId":"P409","status":"loaded","depot":"South"}. All events for P409 share one logical partition. Azure manages the physical partitions underneath. A logical partition is a grouping by key value, not a dedicated server.
| Reader’s request | What the application knows | How to serve it |
|---|---|---|
| Open scan 03 for P409 | Parcel key and item ID | Point-read that item directly. |
| Show all scans for P409 | Parcel key only | Run a query scoped to this parcel. |
| Show every late parcel at South depot | Depot and status | The proposed key cannot route this to one parcel. Query across partitions or maintain a separate depot view. |
“Latest scan” deserves its own design decision. Knowing the parcel does not tell you the ID of its newest event. For a frequently refreshed tracking screen, one option is to maintain a summary item with a predictable ID such as current in the same partition. The customer screen can then point-read it. The writer must keep the summary consistent with the accepted event order, including delayed scans and retries.
Translate traffic into request units
A request unit (RU) measures database work. RU/s measures a rate. A point read, indexed write and cross-partition query can have very different charges. Inspect the request charge reported by the SDK for representative operations. A query that returns several pages needs the charges from all pages.
Suppose a pilot measured 2 RUs per tracking-screen read and 8 RUs per update. At 240 reads and 35 updates a second, that mix would consume 760 RU/s before retries, depot reports and other traffic. These are illustrative inputs. The number is a workload estimate, not a price quote or a throughput setting. Document size, indexing and consistency can change the result. Provisioned throughput reserves capacity, while the serverless model charges for consumed requests subject to its own constraints.
How a sensible-looking key becomes hot
Partitioning by depot might make the manager’s report easier, but imagine a single sorting hub generating half the evening writes. Plenty of distinct depot names in the database would do little for that one busy value. Inspect traffic during the busiest interval as well as storage distribution. A quiet daily average can hide throttling at dispatch time.
Choosing parcel ID spreads ordinary parcel activity more naturally, but a viral tracking link can still concentrate reads on one item. Decide whether a short-lived cache is acceptable before changing the database layout. If the requirement is that a customer immediately sees their own update, choose and test a consistency model using the actual client sessions.
What to settle before committing to Cosmos DB
Write down the three busiest requests. For each, record the partition key available at request time, the number of items touched and the freshness the reader needs. Then measure with a realistically busy key. If the difficult requirement turns out to be a transaction across many related records, the Cosmos DB and Azure SQL Database comparison walks through that decision.
Sources and further reading
Recent articles
Our editorial approach
Clear explanations, practical guidance and responsible research.





