Tuesday, December 19, 2023

Cost of CosmosDB.

Request Units of CosmosDB is like fuel of your car. When you drive your car, it consumes fuel. Similarly, when you use CosmosDB the resources it consumes are measured in Request Units (RUs). You may drive your car on plain road, off-road or anywhere your car consumption is measured in fuel. Similarly, you may perform different actions on CosmosDB it could be a Read query or Write Query the amount of resources consumed is measured in RUs.

Each database operation will have a response header which tracks the number of RUs consumed by the database operation. The cost of your CosmosDB depends on the number of RUs being consumed by it.

#azure #azuresql #azurecosmosdb 

Monday, December 18, 2023

Cost saving in Azure SQL Managed Instance.

We have the option to stop the Azure SQL Managed Instance when it is not in use. Like Azure SQL database which will go to pause state automatically as explained in previous article Azure SQL MI cannot go to pause or stop state automatically, we need to manually Stop/Start it.

Either we need to manually stop the Azure SQL MI instance from azure portal or by executing command. A way to automate this is to schedule the Stop and Stop activity using azure portal Under 'Settings' of Azure SQL MI there is an option 'Start/Stop Schedule'.

Stopping the Azure SQL MI instance will save the vCore and SQL License costs only data and backup storage cost will continue.

If the Azure SQL MI is part of Failover group then such instance cannot be stopped.

#azure #azuresql #azuresqlmi

Friday, December 15, 2023

Cost saving in Azure SQL Database.

In your mobile phone there is a setting to turn off the screen if there is no activity for a certain amount of time. This helps in saving battery.

Similarly, if there is no activity in Azure SQL Database, we have an option to pause the database. This helps in saving cost.

The feature is called 'Auto-Pause' which is available in the Serverless Compute tier.

Once enabled the database will be paused if the CPU = 0 and number of sessions = 0 for a certain amount of time. The threshold that can be set is between 1 HR to 7 Days.

Eg: If we set auto-pause to 1 HR then if the CPU = 0 and number of sessions = 0 for more than 1 HR then the Azure SQL database will be paused.

This feature is supported only in vCore Purchase model and the Hardware Type supported is Standard-series (Gen-5).

The billing is done per second. For a minimum configuration of East US region, it would cost roughly 43 rupees per hour so almost 2000 rupee (almost $24) per weekend for a single database.

If we do a simple math approximately there are total 105 days as weekend in the year 2023. So if we calculate cost for all these days it would total to around 1 lakh rupees ($1300 roughly per year) for a single database.

If your DB will not have any activity during the weekend and by enabling this auto-pause feature this amount of cost saving can be done.

Thanks VV!!

#azuresql #azurearchitect