Managing Azure SQL Database And Azure Storage Costs

In this post I’ll highlight a few ideas around managing Azure SQL Database and Azure Storage costs. It follows on my previous post that looked at managing Azure costs when using Azure Virtual Machines and Azure Subscriptions in general.

Azure SQL Database

  • If you have multiple databases with occasional/spiky workloads you can reduce costs by using Elastic Pools to share the pooled DTUs among your databases. If you use Azure Advisor it will analyse your Azure SQL usage and recommend Elastic Pools if your database instances will benefit from it.
  • Keep an eye on Azure SQL service tier updates. I had some database in the Premium tier purely based on the maximum DTUs per database required but I was able to move some of them to Standard tier after the recent service tier updates.
  • If you have high database performance requirements but you can tolerate a lower SLA and some downtime to recover from backups consider using the Premium RS tier which was in preview at the time of writing.
  • Investigate whether running SQL Server on Azure Virtual Machines will be more cost effective than Azure SQL Database. It depends greatly on your requirements, database size and utilisation but keep the following in mind:
    • If you are using SQL for dev/test you can use SQL Server Developer Edition and avoid SQL licensing costs.
    • If your production databases are very small you could get away with using SQL Express but keep the other limitations in mind.
    • You can bring your own licence for SQL running on Azure VMs.
    • If you have high availability requirements using Azure SQL is much less effort  and cost than running VMs. Azure SQL comes with a 99.99% uptime guarantee. VMs have a 99.95% uptime guarantee if you have multiple instances in an availability set plus you have to replicate to another set of VMs in a second Azure region and pay for multiple SQL licences.
    • If your database is only in use for a portion of the day you can switch the virtual machine hosting it off after hours.

Azure Storage

  • Premium Disks and Managed Disk storage is charged per disk size not disk space used while Standard storage is charged by disk space used.
  • Standard disks incur an access cost measured in 10,000 IO transaction batches but Premium Disks and Managed Disks don’t.
  • You can combine disks to achieve higher IOPS. Weigh up the cost and performance of Premium Storage Disks versus multiple Standard Storage Disks especially if you need lots of space.
  • If your data will not be accessed very often consider using Azure Cool Storage.
  • The default data redundancy setting for Standard Storage is read-access geographically redundant which means you pay for a second copy in another Azure region. For dev/test storage you may not need that level of redundancy since Microsoft keeps 3 copies in the data center anyway and you can rather use locally redundant storage.
  • Delete unused VHD files and Managed Disks. When you delete a VM its disks and underlying VHD files are not deleted. Same goes for VMs using Managed Disks although in this case there is no VHD file visible to you, just the Managed Disk to delete.
  • Don’t create a VM just to host a file share, rather use Azure Files.
 
Francois Delport

Published by

Francois Delport

I am a cloud and devops consultant, technology fan and previously a professional C# developer with a keen interest in system design and architecture. Currently I am involved in projects using Azure, the Microsoft stack and DevOps. I am based in Melbourne, Australia. Email: [email protected]

Leave a Reply

Your email address will not be published. Required fields are marked *