Database: Azure Cosmos DB¶
Summary¶
Use Azure Cosmos DB when you need elastic scale, low-latency global distribution, and document-oriented storage patterns.
Outcome¶
After completing this guide, SkyCMS will connect to Azure Cosmos DB and use it as the primary data store for content, identity, and runtime state.
Steps¶
- Set
ConnectionStrings__ApplicationDbContextConnectioninappsettings.jsonor as an environment variable, including the Cosmos DB account endpoint, account key, and database name. - Review the data modeling and partitioning guidance below before seeding data.
- Start or restart SkyCMS to apply the configuration.
- Complete the setup wizard if this is a fresh installation.
- Verify the connection using the checklist below.
Data modeling guidance¶
- design for partition-aware access patterns,
- avoid hot partitions by choosing high-cardinality partition keys,
- prefer data shapes that minimize cross-partition query cost.
Required settings¶
Use ConnectionStrings:ApplicationDbContextConnection with AccountEndpoint, AccountKey, and Database values.
Partitioning and throughput¶
Recommended practices:
- pick partition keys aligned to dominant query paths,
- monitor RU consumption and tune throughput based on workload,
- capture diagnostics for high-latency or unexpected status responses.
Validation checklist¶
- application starts successfully with Cosmos connectivity,
- sign-in and content operations succeed,
- RU consumption remains within expected range,
- no persistent throttling or partition hot-spot behavior appears in logs.
Diagnostics and troubleshooting¶
- startup failure: verify endpoint, key, and database name,
- high RU usage: inspect query patterns and partition distribution,
- throttling (
429): use retry strategy and review throughput settings.