What problem does it solve?
This skill helps developers and architects design partition keys, choose appropriate consistency levels, and implement SDK patterns so Azure Cosmos DB workloads are performant, cost-efficient, and reliably processed via the change feed.
Core Features & Use Cases
- Partition key design: guidance for high-cardinality keys, hierarchical keys for multi-tenant scenarios, and anti-patterns to avoid hot partitions.
- Consistency & throughput: tradeoffs between Strong, Bounded Staleness, Session, Consistent Prefix, and Eventual consistency and strategies for provisioned, autoscale, and serverless throughput.
- SDK patterns (TypeScript & Python): examples for client initialization, point reads, queries, patch/replace updates, optimistic concurrency with ETags, transactional batches, and bulk imports.
- Change feed processing: iterator and processor patterns, lease containers, and production considerations for processing and retrying.
- Indexing and cost optimization: indexing policy examples, TTL, and strategies to reduce RU costs.
- Use Case: build a scalable orders service where userId is the partition key, process order events via the change feed, and minimize cross-partition queries and RU spend.
Quick Start
Show me how to create a Cosmos DB container with partition key /userId and provide a TypeScript example for point reads and change feed processing.