Study Azure AZ-204 Cosmos DB: key concepts, common traps, and exam decision cues.
This lesson is about the Cosmos DB behaviors Microsoft expects developers to apply correctly from code: operations on containers and items, consistency-level trade-offs, and change feed usage when downstream processes must react to data changes.
Consistency level: Read-behavior setting that trades off latency, availability, and freshness characteristics.
Change feed: Ordered stream of changes in a Cosmos DB container that lets other parts of the system react incrementally.
AZ-204 wants you to separate:
| Need | Strongest first lane | Why it fits |
|---|---|---|
| Read and write JSON-like application data | Cosmos DB SDK operations | Core application data path |
| React when items change over time | Change feed | Incremental downstream processing |
| Decide how fresh reads must be versus latency and distribution trade-offs | Consistency level | Read-behavior decision |
| High-scale event messaging between services | Messaging service, not Cosmos DB change feed as the first answer | Database change tracking is not a general event bus replacement |
| If the question says | Think first about |
|---|---|
| read freshness, stale reads, latency, trade-offs across replicas | consistency level |
| process changed items after writes occur | change feed |
| create, replace, query, or delete app data | Cosmos DB SDK operations |
flowchart LR
A["Application writes item"] --> B["Cosmos DB container"]
B --> C["App reads with chosen consistency level"]
B --> D["Change feed exposes item changes"]
D --> E["Downstream processing reacts incrementally"]
| Trap | Better reading |
|---|---|
| “Change feed is the answer whenever events are mentioned.” | Change feed is strongest when downstream work reacts to Cosmos DB item changes specifically. |
| “Consistency is only a database-admin concern.” | AZ-204 tests whether app developers understand the read behavior their code relies on. |
| “A change feed replaces regular CRUD operations.” | Change feed is a reaction path, not the primary write/read API. |
| “Cosmos DB change feed and Event Grid are interchangeable.” | One is a database change stream; the other is a broader event-distribution model. |
A system stores order documents in Cosmos DB. The application must read with an intentional freshness trade-off, while another component should process newly changed orders without polling the whole container repeatedly.
The strongest reading is:
Correct answer: 1. The problem splits into read behavior and incremental reaction to document changes.