Tuesday, February 4, 2020

Things to know about AutoScale feature of Azure Cosmos DB





     Picking the right amount of Request Unit can be tricky. Your application might get busy in the middle of the day and you might not have heavy traffic at night in your application. When you pick a request unit, Cosmos DB reserves that amount for your application all the time unless you change it programmatically or manually. You might have a DEV environment and your developers might forget to scale down the Request Units and leave for the night or the weekend and you might end up with a big bill for no good reason. You might be developing a new application and you might not have any idea what request unit should be for this application. Another Request unit problem is, if you need to push bulk data to Cosmos DB, you need to adjust Request Unit so your bulk load will finish quickly without taking your OLTP application down.

     If you are having any or all these problems in your Cosmos DB Account, Cosmos DB Team has good news for you. Your new databases and containers are capable to adjust their Request Units now by using a new functionality named Autoscale. You cannot use this in your current databases or containers. Autoscale function was still in public preview when I was writing this.  As the name of the function suggests, Cosmos DB adjusts database’s Requests Unit depending on the traffic it receives. All Cosmos DB asks you what the maximum request unit should be. If you are tired of guessing how much Request Unit you might need for a data load or a busy day for your application, Autoscale can be great solution for you.

     This is all great news, are you wondering if there is a catch? Yes, there is. First, Autoscale will cost you %50 more Request Units. Currently, 100RU/s for a single-region costs you $0.008 per hour. If you use Autoscale 100RU/s will cost, you $0.012 per hour. But since, your Request Unit will get scale down automatically when you don't need it; there is a good chance that you will save money with this rate.

No comments:

Post a Comment