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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
