Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.
3.2.2. Selecting the Right API (Critical Exam Topic!)
💡 First Principle: Cosmos DB is a multi-model database. Selecting the correct API depends on your data model and whether you're migrating an existing application or building new.
API Selection Guide
| Workload / Requirement | Cosmos DB API | Data Model |
|---|---|---|
| New application / General NoSQL | Core (SQL) API | Document (JSON) |
| Migrating existing MongoDB | MongoDB API | Document (BSON) |
| Migrating existing Cassandra | Cassandra API | Wide-column |
| Social networks / Relationships | Gremlin API | Graph (Nodes & Edges) |
| Simple key-value migration | Table API | Key-Value |
Visual: Cosmos DB Multi-Model Architecture
Loading diagram...
⚠️ Common Pitfall: Choosing Gremlin API for simple document storage. Gremlin is specifically for graph queries (relationships). If you just need JSON documents, use Core (SQL) API.