PROTIP: Performance Tuning on the cloud will save you money by the hour

Table of Contents
Note: I'll be focusing on Azure Cloud and SQL Server, but these considerations are valid for any Cloud/DB Vendor.

Whenever people talk about “The Cloud” I often hear: “cloud is expensive” and, sooner or later, “if performance aren’t good we can scale up in minutes later” .
The mindset of taking care of performance issue by scaling up/down cloud resources is a golden egg goose for cloud providers, and a money sink for businesses.

Let’s take databases as an example, let’s assume to run a 24/7 application, the simplest and cheapest Cloud option on Azure is Azure SQL DB:
As you can see from the pricing page, for a general purpose Gen 5 service, prices for a middle/high tier DB offering are the following:

CoresRAMCost/HourYearly CostYearly Cost Difference vs Previous TierYearly Cost Difference vs Previous Tier %
1891.83.8742 €33979.99 €
201024.3047 €37709.17 €3771.18 €10%
24122.45.1656 €45250.66 €7541.48 €16.67%
32163.26.8875 €60334.50 €15083.84 €25%
402048.6094 €75418.34 €15083.84 €20%

A single step up for a single DB can cost from 10% to 25% more than the previous sizing, which translates in 15K or more when dealing with higher specs databases; remember that this is for a single scale up, on a single DB, on a single year.

It’s easy to understand that if your database and/or queries are not well tuned because “scaling will take care of it eventually”, then, you’ll be secretly bleeding money.
Before scaling up, evaluate whether the performance wall that you’re hitting is due to an objectively higher load on the application, or if the pain can be optimized away; if you didn’t have a Developement DBA watching over your application devs it’s pretty much guaranteed to be the second case.

The best results in term of performance optimization, of course, come when the Application and the Database team(s) come together in the early stages of development and both understand how to implement the features to satisfy requirements in a cloud-oriented way.

By performance tuning cloud databases and application, you save money and, moreover, get the nice bonus of an application that’s running smoothly for your customers, win/win.

“Scaling up” should be a temporary fix to allow your DBA & Devs to verify if there is a problem (and correct it) while the application is still up and running. If there is nothing wrong with your queries or application, congratulations!, you definitely have an higher demand, which should mean that you have a bigger revenue, therefore, you can afford to scale up.

comments powered by Disqus

Related Posts

Slides and materials for my session "How to use PowerBI as a Monitoring Tool" @ GroupBy.org

Good news everybody! As you may know if you follow me on Linkedin , I’ve been selected as one of the GroupBy Speakers for the last GroupBy session for 2019!

Read More

A quick function to remove (or keep only) string patterns from SQL Server Strings

Working with strings in SQL Server isn’t as easy or powerful as using any programming language, but, I’m sure that more than once you had to to some data manipulation directly in the database, this may help you out, and it doesn’t use Loops, CLR or XML

Read More

A PowerBI Report for SQL Server Agent Jobs

As my “community service” this month, I’ve worked on this neat (I hope!

Read More