Sign-up now and get instant access
Leave a comment
Customized training to master new skills and grow your business.
Beginner to advanced classes taught by Microsoft MVPs and Authors.
In-depth boot camps take you from a novice to mastery in less than a week.
Season Learning Pass
Get access to our very best training offerings for successful up-skilling.
Stream Pro Plus
Combine On-Demand Learning platform with face-to-face Virtual Mentoring.
Quick references for when you need a little guidance.
Summaries developed in conjunction with our Learn with the Nerds sessions.
Digital goodies - code samples, student files, and other must have files.
Stay up-to-date on all things Power BI, Power Apps, Microsoft 365 and Azure.
Earn money by driving sales through the Pragmatic Works' Training Affiliate Program.
It's time to address your client's training needs.
Learn how to get into IT with free training and mentorship.
Discover the faces behind our success: Meet our dedicated team
How can we help? Connect with Our Team Today!
Find all the information you’re looking for. We’re happy to help.
To continue with my topic of Cosmos DB this week, today I’ll discuss the data consistency models that are supported within the context of Cosmos DB. If you don’t already know, data consistency is the ability of the data to be read once it has been written. When choosing a consistency model, you want to take into consideration consistency, availability and latency.
As you begin to understand what’s going on with Cosmos DB, you’ll realize that we need to have a variety of models. In most scenarios, we have 2 models.
But that’s not a good solution either. What Cosmos DB brings to the table is 3 options with consistency:
1. Session – The most common use case, with over 50% of customers using Session in the platform. Session guarantees that you’re able to see what you wrote. So, if I’m working in the application, I’m going to have a consistent read and write experience.
I get a good user experience, while also not having to wait for everything to fully commit around the globe or for the other pieces to happen to make sure it will eventually catch up. You’ll be able to read your writes, it’s going to come in the right order and all the data will be there.
2. Consistent Prefix – With this you’ll get some of the stuff updated as it starts to go, and the data will come in the right order, but there’s no guarantee that you’re going to get all the pieces you’re expecting. It gives you the opportunity to see less latency in your operation but get more read possibilities.
3. Bounded Staleness – This is where you’ll draw a boundary around what you want to be strong and what you don’t. This is a level deeper towards the strong side from Session. In this case, the reads will lie behind the writes, but you know the interval that you’re lagging. Also, that there’s going to be some inconsistencies over a smaller period of time, but you don’t need to wait for everything to commit. It goes beyond the scope of Session.
We have all these consistency levels available inside Cosmos DB to meet the needs of our various applications. All of these are guaranteed on SLAs. Microsoft guarantees your consistency model will work within the confines that you’ve given the application to work in.
Keep in mind, you need to weigh out things like lower latency with better read scalability and higher availability. If you can live with the latency and it’s more important that you get consistent reads, then you’ll want to lean towards strong. Point being, you have options.
If you’d like to learn more about consistency models in Cosmos DB or any other Azure related topic or product, we are your best resource. Click the link below or contact us—we’re here to help.
Join other Azure, Power Platform and SQL Server pros by subscribing to our blog.