Azure Cosmos DB API Selection

This tutorial guides you through selecting the appropriate API for your Azure Cosmos DB workload, ensuring optimal performance, scalability, and cost-effectiveness.

Understanding Azure Cosmos DB APIs

Azure Cosmos DB is a globally distributed, multi-model database service. It supports multiple data models and APIs, allowing you to choose the one that best fits your application's needs. Each API offers different capabilities and paradigms for interacting with your data.

Core (SQL) API

The Core (SQL) API is the default and most commonly used API for Azure Cosmos DB. It provides a powerful, flexible, and familiar querying experience using a SQL-like query language. It's suitable for a wide range of applications, including web, mobile, gaming, and IoT.

Learn More

MongoDB API

The MongoDB API allows developers to leverage their existing MongoDB skills and tools with Azure Cosmos DB. You can use your favorite MongoDB drivers and applications with Azure Cosmos DB, enjoying its global distribution, scalability, and multi-master capabilities.

Learn More

Cassandra API

The Cassandra API provides the Apache Cassandra wire protocol. This enables you to use your existing Cassandra applications with Azure Cosmos DB, benefiting from its managed service features like global distribution, elastic scalability, and robust SLAs without the operational overhead of managing Cassandra clusters.

Learn More

Gremlin API

The Gremlin API offers a graph database experience, enabling you to work with highly connected data. It uses the Apache TinkerPop Gremlin query language to traverse and manipulate graph structures, ideal for scenarios like social networks, recommendation engines, and fraud detection.

Learn More

Table API

The Table API offers a key-value store experience, similar to Azure Table Storage. It's optimized for storing and querying large amounts of structured, non-relational data, making it a good choice for applications that need a simple, high-performance, and cost-effective storage solution.

Learn More

Choosing the Right API

The decision of which API to use depends heavily on your application's requirements, existing technology stack, and the type of data you are working with.

Recommendation: For most new projects and general-purpose NoSQL needs, the Core (SQL) API is the recommended starting point due to its versatility and rich feature set. If you have existing applications or specific requirements, consider the other APIs.

Factors to Consider:

Key Differences at a Glance

API | Data Model | Query Language | Primary Use Cases ----------------|----------------|----------------|-------------------- Core (SQL) | Document | SQL-like | General Purpose, JSON MongoDB | Document | MQL | MongoDB Compatibility Cassandra | Column-Family | CQL | High Throughput, IoT Gremlin | Graph | Gremlin | Relationships, Networks Table | Key-Value | REST/SDK | Simple Storage, High Scale

Next Steps

Once you've chosen an API, you can proceed to create your Azure Cosmos DB account and start developing your application. Refer to the specific API documentation for detailed setup and development guides.

Explore the quick start guides for each API to get hands-on experience.