Database / Azure Cosmos DB interview questions
What is the Cosmos DB Table API and when would you migrate from Azure Table Storage to it?
The Cosmos DB Table API is a compatibility layer that exposes Cosmos DB as an Azure Table Storage-compatible endpoint. Applications using the Azure Table Storage SDK can point their connection string at a Cosmos DB Table API account and gain Cosmos DB's global distribution, SLA guarantees, and latency improvements without changing application code — only the connection string changes.
Azure Table Storage is Microsoft's original low-cost key-value store. It is cheap, simple, and sufficient for small workloads, but it has significant limitations compared to Cosmos DB:
| Aspect | Azure Table Storage | Cosmos DB Table API |
|---|---|---|
| Latency SLA | No P99 latency guarantee | <10 ms P99 for reads and writes |
| Global distribution | Single region + GRS (read-only secondary) | Multi-region active-active writes |
| Throughput | Throttled at the storage account level | Configurable RU/s per table |
| Consistency | Strong within a region | Five tunable consistency levels |
| Secondary indexes | Only PartitionKey + RowKey | Automatic indexing on all fields |
| Pricing | Lower for cold/rare access | Higher but with more guarantees |
When to migrate: if your Table Storage application is experiencing slow P99 latencies, hitting throughput throttles, needing read replicas in multiple regions for global users, or requiring automatic indexing on fields other than PartitionKey and RowKey — Cosmos DB Table API directly solves all of these. The migration is operationally simple (connection string change) but the cost is higher than Table Storage, so evaluate whether the workload justifies the premium.
More Related questions...