Scenario You have a Cosmos DB collection with 1 million records, and you need to introduce a new property (e.g., Discount ). Your goal is to add this new field without causing downtime , meaning that both the old and new data should work for clients during the transition period. Step 1: Understand Cosmos DB is Schema-less Cosmos DB is a NoSQL database , meaning it doesn't enforce a strict schema. Each document (record) can have a different structure. This gives you flexibility in adding or modifying fields without requiring an actual schema migration, unlike relational databases. In Cosmos DB: Old records can remain as they are (without the new field). New records can be added with the new field. Your task is to handle this evolution in the application code without downtime. Step 2: Update Your Application Model (Add the New Field) You need to modify your application’s data model (e.g., C# class) to include the new field ( Discount ). public class Product { public string ...
Read - Revise - Recollect