Azure SQL Database purchase options and cost savings

by INVOKE Team

Posted on February 04, 2020 at 12:00 AM

What is Azure SQL Database?

Microsoft is well known for their commercial database SQL Server software service(apart from their operating system business) for enterprise clients. Azure SQL Database is a relational database as a service (DBaaS) based on the latest stable version of Microsoft SQL Server Database Engine provided by Microsoft.

One of the biggest advantages with this offering compared with on-prem modal is, scalability. Azure SQL Database enables you to dynamically add more resources to your database with minimal downtime. Consumers can easily purchase a fully managed platform as a service (PaaS) database engine that fits your performance and cost needs as well as scale up and/or scale down the database resources based on need

Costs involved

Typical variable cost components of Azure SQL DB are compute, storage and data transfer rates.

Compute costs: Provisioned compute costs reflects the total compute capacity that is provisioned for the sql database while launching the application.

Storage costs: User will be charged for the provisioned storage based upon the maximum database or pool size you select. The cost doesn't change unless you reduce or increase that maximum.Different types of storage are billed differently. Backup storage is associated with automated backups of your instance and is allocated dynamically. Increasing your backup-retention period increases the backup storage that’s consumed by your instance.

Purchasing options

Azure SQL DB is available for purchase in two different models:

Virtual core (vCore)-based purchasing model This is recommended purchasing model which provides a choice between a provisioned compute tier and a serverless compute tier. Provisioned compute tier allows users to choose the exact amount of compute resources needed for your workload. The vCore-based purchasing model gives you flexibility, control, transparency of individual resource consumption, and a straightforward way to translate on-premises workload requirements to the cloud. The vCore unit price per unit of time is lower in the provisioned compute tier than it is in the serverless compute tier. A virtual core (vCore) Azure representation of logical CPU and offers you the option to choose between generations of hardware and the physical characteristics of the hardware (for example, the number of cores, memory, and the storage size). The vCore-based purchasing model lets you independently choose compute and storage resources, match on-premises performance, and optimize price. In the vCore-based purchasing model, you pay for: A) Compute resources (the service tier + the number of vCores and the amount of memory + the generation of hardware). B) The type and amount of data and log storage. C) Backup storage (RA-GRS). If your single database or elastic pool consumes more than 300 DTUs, converting to the vCore-based purchasing model might reduce your costs. Database transaction unit (DTU)-based purchasing model. This purchasing model provides bundled compute and storage packages balanced for common workloads. If you prefer the simplicity of a preconfigured bundle and fixed payments each month, the DTU-based model might be more suitable for your needs. A database transaction unit (DTU) represents a blended measure of CPU, memory, reads, and writes.

If you want to migrate an existing on-premises or SQL Server virtual machine workload to Azure SQL Database, use the DTU calculator to approximate the number of DTUs needed.

Reduce Azure SQL Database bill - How?

Apart from scalability cloud consumers use cloud resources to reduce the costs. Cloud consumers should use proper cloud economic principles to reduce their costs and unwanted spending. There are a lot of database level fine tuning can be done to get the best performance out of the resources purchased. Apart from tuning, users need to pay attention towards reducing Idle resources or right sizing based on-demand.

Scale up (or) scale down SQL Databases - One way of Cost Savings:

Scalability is one of the most important characteristics of Azure Database PaaS service, that enables you to dynamically add more resources to your service when needed. Azure SQL Database enables you to easily change resources (CPU power, memory, IO throughput, and storage) allocated to your databases. You don’t need to worry about purchasing hardware and changing underlying infrastructure.

You can change DTU service tiers or vCore characteristics at any time with minimal downtime to your application (generally averaging under four seconds). For many businesses and apps, being able to create databases and dial performance up or down on demand is enough, especially if usage patterns are relatively predictable.

Note that, this approach is NOT recommended for applications which are NOT tolerant for any downtime because, initiating scale up or scale down action in any of the flavors would restart database engine process and move it to a different virtual machine if needed. Moving the database engine process to a new virtual machine is an online process where you can continue using your existing Azure SQL Database service while the process is in progress. Once the target database engine is fully initialized and ready to process the queries, the connections will be switched from source to target database engine. You can expect a short connection break when the scale up/scale down process is finished. If you have implemented Retry logic for standard transient errors, you will not notice the failover.

Misconception with Azure SQL Database reserved capacity :

Azure allows users to reserve capacity while launching SQL databases. Users prefer this option to save money with Azure SQL Database by committing to a reservation for compute resources compared to pay-as-you-go prices. By purchasing a reservation, you are committing to usage for the compute costs for a period of one (or) three years. As soon as you buy a reservation, the SQL Database compute charges that match the reservation attributes are no longer charged at the pay-as-you go rates. A reservation does not cover software, networking, or storage charges associated with the SQL Database instance.

But, the misconception we have observed is, there is nothing more to save while using reserved capacity, which is NOT correct. Even with reserve capacity, vCore size flexibility option helps in scale up or down within a performance tier and region, without losing the reserved capacity benefit, based on Azure documentation. We strongly recommend users to take advantage of this by scaling down with in tier while resources are not in demand.

In summary, Azure SQL Database is a great service to host their database in the cloud. Pick the right purchasing option to run the workloads. Use proper cloud economic principles like scale up or down the resources to reduce cloud bill. Have any questions? Contact Us. Happy to help!