Database / Azure Cosmos DB interview questions
What is the Cosmos DB Cassandra API and how does CQL map to Cosmos DB concepts?
The Cosmos DB Cassandra API exposes Cosmos DB as a Cassandra-compatible data store using the Cassandra Query Language (CQL) wire protocol. Applications built on Apache Cassandra — using drivers like DataStax Java Driver, Python driver, or the gocql Go driver — can connect to Cosmos DB by changing the endpoint and credentials, without modifying application code.
CQL concepts map to Cosmos DB concepts as follows:
| Cassandra Concept | Cosmos DB Equivalent |
|---|---|
| Keyspace | Database |
| Table | Container |
| Row | Item (document) |
| Partition Key | Partition Key |
| Clustering Column | Part of the item schema (ordering within a partition) |
| Secondary Index | GSI / Cosmos DB index |
Key behavioral differences from native Cassandra to know for interviews:
- Consistency model — Cosmos DB applies its own 5-level consistency model. Cassandra consistency levels in CQL (
LOCAL_QUORUM,ONE, etc.) are accepted by the API but mapped to the account-level Cosmos DB consistency setting, not enforced as true Cassandra quorum reads. - Lightweight Transactions (LWT) — Cassandra's
IF NOT EXISTSandIF conditioncompare-and-swap operations have limited support in Cosmos DB Cassandra API. Full LWT support is not guaranteed. - Tunable throughput — Unlike Cassandra where you scale by adding nodes, Cosmos DB Cassandra uses RU/s provisioning. There is no concept of a Cassandra ring or token range management.
- No compaction or repair — Cosmos DB manages its own storage internally. Cassandra operational tasks like
nodetool compactornodetool repairdo not exist.
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...
