Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
4.2.2. Selecting the Right API (SQL, Mongo, Gremlin, etc.)
💡 First Principle: Cosmos DB is a multi-model database. The API you choose determines the data model and query language. Selecting the correct API depends on whether you're migrating an existing application (match the existing API) or building new (usually Core SQL for flexibility).
API Selection Guide
| Workload / Requirement | Cosmos DB API | Data Model |
|---|---|---|
| New development, general purpose | Core (SQL) API | Documents (JSON) |
| Existing MongoDB application | MongoDB API | Documents (BSON) |
| Graph relationships (social networks) | Gremlin API | Nodes and edges |
| Simple key-value storage | Table API | Key-value entities |
| Existing Cassandra application | Cassandra API | Wide-column |
Visual: Cosmos DB API Selection
⚠️ Exam Trap: If a question mentions "nodes and edges" or "relationships between entities" (like friends in a social network), the answer is Gremlin API—not Core SQL.
Written byAlvin Varughese
Founder•15 professional certifications