Crazy Ballmer’s Database Hut is having the fire sale of the century! SQL Azure pricing is sliced in half or more. We must be crazy, they say! Check out these discounts:
When SQL Azure first came out with its absurd limitations (no backups, tiny database sizes), I viewed the pricing the same way I view cocaine pricing. You’d have to be pretty stupid to do cocaine, but if you do, then you’re not really the kind of person who’s deterred by astronomically high prices anyway. (You’re probably proud of the high prices, come to think of it.)
Today, it’s a different story. We’ve got:
- Databases up to 150GB
- Federations to make sharding easier (not easy, but easier)
- Backup capabilities
- Reasonable pricing
Suddenly, SQL Azure isn’t cocaine anymore. I’m not saying you’ll want to start sniffing it today, but for starters, why not run a query to find out how much your own server would cost to host in SQL Azure?
SELECT @@SERVERNAME AS ServerName ,
DB_NAME(database_id) AS DatabaseName ,
SUM(( size * 8.0 ) / 1048576) SizeGB ,
SQLAzurePrice = CASE WHEN SUM(( size * 8 ) / 1048576) > 150
WHEN SUM(( size * 8.0 ) / 1048576) > 50 THEN (125.874 + ((SUM(( size * 8.0 ) / 1048576) - 50) * .999))
WHEN SUM(( size * 8.0 ) / 1048576) > 10 THEN (45.954 + ((SUM(( size * 8.0 ) / 1048576) - 10) * 1.998))
WHEN SUM(( size * 8.0 ) / 1048576) > 1 THEN (9.990 + ((SUM(( size * 8.0 ) / 1048576) - 1) * 3.996))
WHEN SUM(( size * 8.0 ) / 1024) > 100 THEN 9.990
WHERE type_desc <> 'LOG'
GROUP BY DB_NAME(database_id)
ORDER BY DB_NAME(database_id)
Disclaimer: that query is probably wildly inaccurate because I write horrendous T-SQL and barely tested it. For exact pricing, check the Azure pricing page and scroll down for SQL Azure, or use the Azure pricing calculator.
My query lists the data file sizes – not the actual data sizes, so if you’ve comically overprovisioned your files with lots of empty space, you’ll get artificially high SQL Azure costs. That’s how I like to do my projections, though – if I’m worried that the data will grow to a certain size, then I size the database for it, and that’s a reasonable projection number for my SQL Azure costs as well.
That query also doesn’t warn you about features you’re using that aren’t available in SQL Azure, nor the security challenges of having your customer data offsite, nor does it cover how your applications might be impacted by a database that lives outside of your network, yadda yadda yadda. These aren’t unsolvable challenges – especially when the price is right, and today, it’s gotten a lot closer to right.
Here’s the much harder query to write: we need to be ready when management asks, “So how much does it cost to host these databases on-premise, and do we have three replicated copies like SQL Azure?” SQL Server 2012’s AlwaysOn Availability Groups get us much closer to that solution, but it ain’t cheap.