Azure Cosmos DB APIs

Explore the different APIs available for Azure Cosmos DB, a globally distributed, multi-model database service. Choose the API that best suits your application's needs.

Core (SQL) API

The Core (SQL) API is the default and most commonly used API for Azure Cosmos DB. It provides a rich, document database querying experience with a familiar SQL syntax.

Features:

  • Powerful SQL query language
  • JSON document support
  • Schema-agnostic
  • Scalable
-- Sample SQL Query SELECT * FROM c WHERE c.category = "electronics" AND c.price < 100

Learn more about Core (SQL) API »

MongoDB API

The MongoDB API enables you to use Azure Cosmos DB as a document database for your MongoDB applications. It's compatible with the MongoDB wire protocol.

Features:

  • Compatibility with existing MongoDB drivers and tools
  • Global distribution and scalability
  • Managed service benefits
// Sample MongoDB Query db.items.find({ "category": "books", "price": { "$lt": 50 } })

Learn more about MongoDB API »

Cassandra API

The Cassandra API provides Apache Cassandra-like data modeling and query capabilities. It's ideal for applications that require high availability and tunable consistency.

Features:

  • Cassandra Query Language (CQL) support
  • Wide-column store capabilities
  • High throughput and low latency
-- Sample CQL Query SELECT * FROM users WHERE lastname = 'Smith';

Learn more about Cassandra API »

Gremlin API

The Gremlin API is a graph database API that uses the Apache TinkerPop Gremlin query language. It's perfect for building applications with complex relationships and traversals.

Features:

  • Gremlin traversal language
  • Graph data modeling
  • Real-time graph analytics
// Sample Gremlin Query g.V().has('name', 'Alice').out('knows').values('name')

Learn more about Gremlin API »

Table API

The Table API offers a key-value store similar to Azure Table Storage. It's suitable for applications that need a simple, scalable NoSQL key-value store.

Features:

  • Key-value storage
  • Simple query capabilities
  • High scalability
// Sample Table API Operation (Conceptual) // Retrieve entity with PartitionKey='Customers' and RowKey='123'

Learn more about Table API »