Is it time to move from SQL Azure to Amazon RDS SQL Server?
I am aware that Microsoft appears to be dropping the Azure brand, renaming SQL Azure as SQL Database, but for the purposes of this post I will stick with the old names.
In the middle of 2011 we shipped a brand new system to a customer. This system required a couple of databases, a web server and some windows services hosting. The processing demand wasn’t high so it could easily fit on a small dedicated server.
Our customer had no IT support staff and we did not want the support the infrastructure. As we were already using Amazon SQS (Simple Queue Service) we immediately thought of using an Amazon EC2 instance running SQL Express. It became obvious very quickly that getting failover to work well was not going to be a quick job and we did not have the time. The quotes for fully managed dedicated servers ran into several thousands and tied them in for between 1 and 3 years. That left us with Windows Azure as the most appropriate option.
We ended up with a couple of databases, a web role and a couple of worker roles – all working fine on extra small instances. Moving from a single server solution did require changes to some parts of the application and effort was required to reduce the chattiness of communications with the database (as with any hosted database). So at this point we were using the best choice for the client.
Competition is generally a good thing so I was very pleased to hear that Amazon has extended RDS (Relational Database Service) to include SQL Server in addition to MySQL and Oracle. We have used Amazon RDS for MySQL so I was very keen to see what it could offer with SQL Server. So naturally I wanted to see if we are still in the right place for our Azure-based customer.
It doesn’t take long to realise that Amazon RDS SQL Server is a very different beast to SQL Azure.
Database features
Amazon RDS SQL Server gives you a full SQL Server installation so it supports all the core database engine features. Using SSMS you would be hard-pushed to spot you are connected to a hosted database. You have access to all the data management views and functions and if you really want to go to town you can even run SQL Profiler remotely (be very tight on your filtering!). The full list of features is here.
If you look closely there are a few features that aren’t supported that may send you running for the hills. A big one for us is encryption. With SQL Azure we are able to connect using SSMS using an encrypted connection and administer the database without any worries about prying eyes. We also configured the web site and the worker roles to use encrypted connections. The recommended solution in the AWS world is to use a bastion host, whilst this is a very sensible way of going about your production access. But in a project of this size that is an overhead which I would prefer to do without. And I still like the added comfort of knowing that all the traffic is encrypted.
With SQL Azure you aren’t running with a full SQL Server installation. You can’t get under the covers to access data management views and functions and even old faithful stored procedures like sp_spaceused don’t work: you have to resort to querying the system tables. READ_COMMITTED_SNAPSHOT and ALLOW_SNAPSHOT_ISOLATION are set on and you can’t change them. Also you must have clustered indexes on all tables. The full list is here of the limitations.
Processing power and database size
With Amazon RDS SQL Server you can pick the storage size you want from 20GB up to 1TB – this is data and log space combined. You can also pick the amount of memory in your server from 630MB (Micro) all the way up to 68GB (High-Memory Quadruple Extra Large) and similar choices in processing capacity.
SQL Azure you don’t get the option of picking the hardware, it is what is it. The database size is worked out differently. You only pay for what data you use starting at just 100MB but only going up to 150GB. Log file space is not charged for but you are billed for each database.
Backup and availability
With Amazon RDS SQL Server you are not able to do multiple availability zone deployments, so no real-time replication built-in, but transactions logs do get backed up every 15 minutes. But you control when backups and maintenance can happen. Backups can be kept for up to 31 days.
SQL Azure each database replicated and there are multiple redundant copies, hence the need for all tables to have a primary key. So in theory you don’t need to backup your databases. Not being conformable with this we have been using Redgate tools to handle this for us.
Administration
With the AWS management console you are confronted with 20+ products that you may or may not be using. Finding the status of your environment quite a few clicks, and you need to know where you are going. The interface is fine for techies but our customer glazed over when we tried to show them the SQS management tab, at which point we didn’t bother showing them about the EC2 instances. As with EC2 you get the basic CloudWatch monitoring where you can set-up alarms with email alerts.
On the other hand the Windows Azure Platform management console, is a much simpler. It is Silverlight (plugin required), is sometimes buggy and is painful to use on a slow connection. However as it is simpler; you still need to know where you are going but when you have got there the status information is easy to make out. Our non-technical customer can easily see what is happening and reboot the web and worker roles if they see an issue. The downside is that other than very high level monitoring you don’t get monitoring out of the box with Azure. There is the System Center Monitoring Pack for Windows Azure Applications here but it most definitely isn’t a simple matter to set it up.
Conclusion
Amazon RDS SQL Server
Pros
- Full database support
- You get an instance so you can have up to 30 databases
- Database backups can be controlled and kept for up to 31 days
- Good monitoring framework built-in
- Database sizes up to 1TB
- Can select the instance size according to workload
Cons
- Multiple Availability Zone deployments not supported
- No SSL connection
- Alphabet soup administration interface
- Smallest disk size 20GB
SQL Azure
Pros
- Small, cheap databases
- Simple administration interface
- Multiple redundant copies of the database
- Encrypted connections
Cons
- You can’t choose the hardware you are running on
- Only supports databases up to 150GB
- Limited SQL Server features
- Only very high level monitoring by default
For the time being we are happy to stay on the Azure platform for this application. But the ability to choose what level of hardware and the much larger database sizes make Amazon RDS SQL Server a very interesting option for the future. Which one should you choose? It depends…
Over the next few weeks I’ll be posting more to help you decide, looking at costs and performance. This article will be updated with links to the later articles – or subscribe to our RSS feed. Stay tuned!