Skip to main content

Cosmos DB

Azure Cosmos DB is a fully managed NoSQL database for building highly responsive and scalable applications. It supports multiple data models and offers global distribution with low latency.

Key Features

  • Multi-model support (document, key-value, graph, column-family)
  • Global distribution with multi-region writes
  • Automatic scaling and high availability
  • Tunable consistency levels

Example Usage

// Create and read a document in Cosmos DB
var client = new CosmosClient(endpoint, key);
var container = client.GetContainer("db", "orders");
await container.CreateItemAsync(order, new PartitionKey(order.id));
var response = await container.ReadItemAsync<Order>(order.id, new PartitionKey(order.id));

Real-World Application

You use Cosmos DB to store user profiles, order data, or telemetry for applications that require low latency and global scale.