Build Fault Tolerant Applications With Cassandra API for Azure Cosmos DB

Azure Cosmos DB is a resource governed system that allows you to execute a certain number of operations per second based on the provisioned throughput you have configured. If clients exceed that limit and consume more request units than what was provisioned, it leads to rate limiting of subsequent requests and exceptions being thrown — they are also referred to as 429 errors.

With the help of a practical example, I’ll demonstrate how to incorporate fault-tolerance in your Go applications by handling and retrying operations affected by these rate limiting errors. To help you follow along, the sample application code for this blog is available on GitHub — it uses the gocql driver for Apache Cassandra.

How to Use Caching With Azure Cosmos DB

Cosmos DB is the new NoSQL database released in Azure Cloud by Microsoft. Unlike relational databases, Cosmos DB is scalable as it is a hosted database service, so it enjoys a lot of popularity among high transaction .NET and .NET Core applications.

However, using Cosmos DB, you need to be wary of performance bottlenecks and cost overhead for accessing the database as Microsoft charges you for each transaction to Cosmos DB. While Cosmos DB is scalable in terms of transaction capacity, it is not as fast because the database service is living in a separate VNet or subscription than the applications. So even if your applications are running in Azure cloud, accessing the database across the VNet is a huge blow to the performance.

Cosmos DB and Node SDK Part 1: Working With Databases

There have been so many things I've learned in the last few years and I wanted to share my learnings, but one thing or another kept me away. I am hoping that I will break this silence and post regularly going forward.

With my work on Cerebrata Cerulean, I got an opportunity to work a lot with Node.js and some amazing Azure services. In this series of posts, I am going to focus on using Azure Cosmos DB service with their Node SDK. We will cover working with various entities like databases, containers (collections), documents, etc. using Node SDK.