Cosmos DB Native Schema Version Toggle for Deployment Rollback
0 reputation · 03 Oct 2023, 16:04 UTC
Cosmos DB Native Schema Version Toggle for Deployment Rollback
Azure Cosmos DB is schema-agnostic, so application deployments often write documents with new structures without a database-enforced schema version. When a deployment fails validation after those writes, the database has no native mechanism to automatically revert document structures to a previous state.
The Transactional Batch API provides atomicity only within a single logical partition and is capped at 100 operations and 2 MB. Reverting an index policy does not undo data transformations already applied to documents, which leaves cross-partition rollback behavior undefined.
Does Cosmos DB expose a native schema version property or toggle that can trigger automatic document structure reversion after a failed deployment? Can Transactional Batch atomically roll back schema-related writes across multiple logical partitions? What document compatibility behavior should applications maintain when rolling back application code without a database-level schema revert?