Azure CosmosDB SQL

Azure Cosmos DB SQL is a fully managed NoSQL database for modern app development using Azure CosmosDB's SQL API.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Made by

Massdriver

Official

Yes

Azure Cosmos DB SQL

Azure Cosmos DB SQL is a globally distributed, multi-model database service designed for managing data at a large scale with low latency and high availability. It offers fast performance, scalability, and seamless integration with other Azure services.

Design Decisions

  • Consistency Levels: Supports Strong, BoundedStaleness, Session, ConsistentPrefix, and Eventual, configurable based on the client's requirements.
  • Geo-Redundancy: Options for automatic failover and multi-region writes to enhance resilience.
  • Network Security: Virtual network filters are enabled, with public network access disabled by default.
  • Backup: Configurable for either Continuous or Periodic backups catering to different data recovery needs.
  • Serverless: Supports serverless configurations offering dynamic scaling for unpredictable workloads.

Runbook

Unable to Connect to Azure Cosmos DB SQL

This problem might occur due to network security configurations or incorrect authentication details.

Check the connection string and authentication info:

az cosmosdb keys list --name <cosmosdb_account_name> --resource-group <resource_group> --type keys

You should expect to see the primary and secondary keys.

High RU Usage Alerts

If you're receiving alerts about high RU (Request Unit) usage, investigate which operations are consuming the most RU/s.

Use the Azure portal metrics:

az monitor metrics list --resource <cosmosdb_account_resource_id> --metric "NormalizedRUConsumption"

Look into the recent metrics and evaluate if your throughput settings are adequate.

High Server Latency

High server latency might indicate the need for throughput scaling or that the database is under heavy load.

Check the current server latency metrics:

az monitor metrics list --resource <cosmosdb_account_resource_id> --metric "ServerSideLatency"

Data Consistency Issues

If you experience data consistency issues, ensure the consistency level is appropriately set as per your application's requirements.

Check the current consistency level:

az cosmosdb show --name <cosmosdb_account_name> --resource-group <resource_group> --query "consistencyPolicy"

For consistency level changes, plan during low-traffic periods and verify with business requirements.

Backup Configuration Issues

If backups are not functioning as expected, verify the backup settings.

az cosmosdb show --name <cosmosdb_account_name> --resource-group <resource_group> --query "backupPolicy"

Check for settings that might be incorrectly configured, like backup interval and retention.

Checking Data Throughput Limit

Examine the total throughput settings to ensure they match your workload.

az cosmosdb sql container throughput show --resource-group <resource_group> --account-name <cosmosdb_account_name> --database-name <database_name> --name <container_name>

This ensures that your container has the appropriate throughput setting to handle the load.

Ensure to respond to any anomalies or updates reflected by these commands to maintain optimal performance and reliability of your Azure Cosmos DB SQL service.

VariableTypeDescription
backups.backup_typestringThe backup type to use for the Cosmos DB account (cannot be changed after deployment).
database.consistency_levelstringThe consistency level to use for this CosmosDB Account.
database.serverlessbooleanNo description
database.total_throughput_limitintegerThe total throughput limit imposed on this Cosmos DB account in RU/s (-1 means no limit).
geo_redundancy.additional_regions[].failover_priorityintegerThe failover priority of the region. The lower the value, the higher the priority is. Minimum value is 2, maximum value is 100.
geo_redundancy.additional_regions[].locationstringThe Azure region to host replicated data.
geo_redundancy.automatic_failoverbooleanNo description
geo_redundancy.multi_region_writesbooleanNo description
monitoring.modestringEnable and customize Function App metric alarms.
network.autobooleanEnabling this will automatically select an available CIDR range for your database. Unchecking will require you to specify the CIDR.