Overview of Azure Cosmos DB Table API

The Azure Cosmos DB Table API is a NoSQL key-value store that supports schemaless data. It is designed for applications that need a highly scalable and globally distributed data store with low latency. The Table API is a great choice for applications that require the simplicity and flexibility of a key-value store while benefiting from the advanced features of Azure Cosmos DB.

What is the Table API?

The Table API in Azure Cosmos DB is built on the foundation of Apache Cassandra. It provides a familiar interface for developers who have worked with the Azure Cosmos DB Table API (formerly DocumentDB Table API) or Azure Table Storage. It allows you to store and query large amounts of structured, semi-structured, and unstructured data in a document database.

Key Features:

Use Cases

The Table API is ideal for a variety of scenarios, including:

Getting Started

To start using the Table API, you need to create an Azure Cosmos DB account and then create a Table API database. You can then use various SDKs to interact with your data.

Tip: For a quick start, consider using the Create a Table API account guide.

Data Model

In the Table API, data is stored in tables. Each table contains entities, and each entity is a collection of properties. Properties are key-value pairs, where keys are property names (strings) and values can be one of several supported data types.

Learn more about data modeling best practices.

Querying Data

You can query your data using a rich query language. The Table API supports filtering, sorting, and projecting properties. Queries are typically optimized when they include the partition key and row key.


// Example query (conceptual, syntax may vary by SDK)
SELECT * FROM c WHERE c.PartitionKey = 'user123' AND c.RowKey = 'profile'
            

Explore different querying techniques.

Migration

If you have existing data in Azure Table Storage or other NoSQL databases, the Table API offers tools and guidance for seamless migration. This allows you to leverage the advanced features of Azure Cosmos DB without a complex re-architecture.

See the migration guide for detailed instructions.

Note: The Table API is highly compatible with the Azure Table Storage API, making migration often straightforward.

Next Steps

Continue your learning journey by exploring the following topics: