Skip to main content

Posts

Showing posts from May, 2020

[Post Event] Today Software Magazine (TSM) - How does consistency levels affects the latency of Azure CosmosDB

On May 26th, I had the amazing opportunity to speak at the TSM event about Azure Cosmos DB and what is the latency impact on our application. If you want to find more about it you can read the full article on the TSM magazine . Below you can find the slides used during the session. Do you have questions? You can write to me on Linkedin or Twitter. How does consistency levels affects the latency of Azure CosmosDB from Radu Vunvulea

Should(n't) peek and lock a message from Azure Service Bus for 5 hours

Let’s talk about anti-patterns when business drives technology. Imagine that you are working for a bank where you implement a message base communication build on top of Azure Service Bus. Everything works great for a few years until one of the business stakeholders implement their business application in such a way that a message needs to be locked for 5 hours. They used competing consumer pattern to support business requirements -  to wait for confirmation from external users for a maximum of 5 hours. If there is no confirmation from the users, the request (message) shall be processed one more time. Issues There are some mistakes in the way how business reqs was implemented: (1) The maximum Peek and Lock of a message from Azure Service Bus is 5 minutes. It is impossible to peek a message from a subscription or queue and do a lock for 5 hours. (2) It does not clearly define the number of retries. If the user(s) does not confirm the action would mean that the message will be av

How does consistency levels affects the latency of Azure CosmosDB

Azure Cosmos DB has 5 different consistency levels (Strong / Bounded Stateless / Session / Consistent Prefix / Eventual). Each consistency level can affect the latency of operations that we are doing on the storage. In this post we will try to respond to the following question: What is the latency impact of different consistency level?  Latency in general The current SLAs are offering us the guarantee that the READ and WRITE operation is in 99% of the cases under 10ms. The average latency of the current content fetch from Azure Cosmos DB is under 4ms in 50% of the cases. The write operations are a little slower, reaching maximum 5ms in 50% of the cases. This is applicable only for Bounded Stateless / Session / Consistent Prefix and Eventual. For Strong consistency and databases across multiple regions, the latency is higher, but this is expected because of the replication requirements. For example if you have Strong consistency on a database that is replicated in two differe