Memory hook: Point read cheaply; retry safely; process changes twice safely.
Must remember
- A point read uses item id and partition key and is usually cheaper than an equivalent query. Parameterize queries and use paging/continuation tokens for bounded result processing.
- Create, replace, patch and delete have different update semantics. ETags with conditional requests implement optimistic concurrency so a stale writer does not silently overwrite a newer version.
- Transactional batches operate within a supported logical partition boundary. Bulk execution improves throughput across operations but is not one global atomic transaction.
- TTL expires eligible items according to container/item configuration; expiration is not a precise scheduling mechanism. Account for expired data in retention, change processing and recovery design.
- Change feed supports reactive processing. The processor coordinates work through a lease container; pull mode gives the application more direct control. Latest-version versus all-versions-and-deletes modes have different prerequisites and event semantics.
- Make consumers idempotent and checkpoint only after successful work. Copy-container jobs support suitable data movement; Agent Kit/AI-assisted scaffolding can accelerate development but generated partitioning, security and retry choices still require review.
Choose under exam pressure
| Requirement | Choice and reason |
|---|---|
| Fetch one known item | Use id plus partition key for a point read. |
| Prevent lost updates | Conditional writes using the current ETag and conflict handling. |
Traps
- Bulk writes do not make operations across arbitrary partitions atomic.
- Change-feed processing must not assume a side effect will only ever be attempted once.
Active recall
1. Why use continuation tokens?
To resume bounded query pages without loading the entire result set.
2. What is a lease container for?
Coordinating ownership/checkpoints among change-feed processor instances.
3. When choose patch?
For supported partial updates when replacing the whole item is unnecessary.
4. What must be checked before using all-versions-and-deletes feed?
Account prerequisites, retention and supported mode semantics.
5. How review AI-generated data code?
Check key choice, authorization, concurrency, retries and realistic query cost.