Database / Azure Cosmos DB interview questions
What are the different APIs available in Azure Cosmos DB?
Azure Cosmos DB is a multi-model database, meaning a single back-end engine exposes different wire-protocol-compatible APIs so you can interact with data using the client libraries and query syntax you already know. As of 2024, six APIs are available:
| API | Data Model | Best For |
|---|---|---|
| NoSQL (Core) | JSON documents | New applications, native Cosmos SDK, richest feature set |
| MongoDB | BSON documents | Migrating existing MongoDB apps; wire-compatible with MongoDB drivers |
| Cassandra | Column-family / CQL | Migrating Apache Cassandra workloads; CQL wire protocol |
| Gremlin | Property graph | Social graphs, recommendation engines, highly connected data |
| Table | Key-value (entities) | Migrating Azure Table Storage apps with minimal code changes |
| PostgreSQL (vCore) | Relational / SQL | Distributed relational workloads using the Citus extension on PostgreSQL |
The NoSQL API is the native API with the fullest feature parity — it supports the richest query language, all five consistency levels, server-side JavaScript (stored procedures, triggers), and change feed. The other APIs are compatibility layers that let you point existing drivers at Cosmos DB. The MongoDB API, for example, implements the MongoDB wire protocol, so a Node.js app using Mongoose can switch from Atlas to Cosmos DB by changing the connection string with no code changes.
An important nuance: each account is bound to one API at creation time. You cannot switch APIs after account creation, so choosing the right API upfront is critical. If you have no legacy migration requirement, the NoSQL API is always the recommended starting point.
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...
