Lower the cost of Azure pricing through Tools, Promotions and Technology Decisions
Abstract: In this article I will show some techniques to lower the costs of using the Windows Azure Platform. We will look at three different methods of lowering the cost of Azure: via tools, promotions and technology architecture decisions that can dramatically impact costs of using the Azure cloud platform.
Tools: Azure Platform Pricing Calculator
The first step in understanding your costs and how to lower them in Azure is to forecast the costs of the services in Azure. Until recently this was largely a manual effort and an architect or technical business owner would have to sift through pricing grids (like this one) and tally the numbers yourself.
Microsoft has released the Azure Platform Pricing Calculator that allows you to easily select the services you need and determine their costs very easily. This not only allows you to make planning easier, but it also can dramatically lower your costs by showing you cheaper options available (i.e. promotions or smaller instances of Compute). The Azure Platform Pricing Calculator can also show you the different costs associated with architectural options (i.e. having a 100gig SQL Server database is about $1,000/month versus table storage of the same size is $15/month + minimal costs with storage transactions).
Promotions & AzureOffers: Look at All the different Microsoft Azure options
Microsoft is really pushing Windows Azure. A lot of their core evangelists, program managers and sales teams are pushing the platform to the enterprise. Furthermore, there are a lot of deals to attract business owners, consultants, developer hobbyists as well. Make sure you shop around for the BEST deal.
These will probably change, but there are several different FREE trials available to try Azure and lower your costs.
- Microsoft offers a no credit card required 30-day trial of Windows Azure Platform trial here.
- Microsoft offers a credit card required offer until September 30th, 2011 FREE trial here.
MSDN Subscribers have the ability to get components and Azure services for FREE at a certain limit for FREE as well. The higher level of your MSDN Subscription, the more is alotted to you (for example a MSDN Ultimate Subscription has 1,500 hours/month of a compute instance available).
Other Business & Partner Agreements:
If you are a large customer from Microsoft, you can obviously negotiate better enterprise pricing for Azure ("You can negotiate?...yes"
). However, if you are a small business or a startup you can also participate in either the "Cloud Essentials" Microsoft partner program
or the Microsoft BizSpark program
, which allows you to take advantage of the Windows Azure platform at lower costs as well.
You can compare all of the offers from Microsoft in a nice grid here
Technology Architecture Considerations:
SQL Azure Alternatives
SQL Azure is EXPENSIVE (especially for very large sites). Even for a small site like mine, which has a read-only SQL Server database...I did not want to pay $10/month ($120/year for a 1 gig database). Here are some alternatives:
- Use SQL Server CE 4. It is a new embedded database that can be deployed to the web role in Azure. The nice thing is that you will not have to pay for storage or transactions, because it is part of the web role. The downside is that you will have to be responsible for your own disaster recovery. This would not work great for mission critical or very transactional databases. However, small databases with read-only historical data (i.e. baseball stats), aggregate caching databases (i.e. map reduce business intelligence) or low transaction databases (i.e. a blog) would be great candidates and save you a lot of money.
- Combine Data Content Data Sources. If you have multiple data sources...look for ways to combine them into a single data source. For example, if you have a small blog and a membership of ASP.NET..instead of paying $9.99/month x 2 for two databases...why not combine them into a single database and pay $9.99/month? In those cases, proper naming conventions in SQL will save you and allow you to do this.
- Use NOSQL Databases. Not every single web site needs a relational database behind the scenes. Sites like Google, Facebook or Reddit use NOSQL storage almost exclusively to power their entire platforms. For example, a .NET Lucene library port for Azure exists, which uses local caching heavily as well as Azure Blob storage which is significantly cheaper than SQL Azure. Using the Azure infrastructure/SDK you can even run NOSQL databases like MongoDB on Azure as well. Azure Table storage is another "NOSQL like" alternative in the Azure platform that is much cheaper than SQL Azure.
- Use cheaper cloud storage databases. If you are a .NET developer or prefer working with the Microsoft cloud tools nothing is stopping you from using different cloud content alternatives. For example, you can host your database on Amazon EC2 and have the front-end or compute instances deployed to Windows Azure.
- Sometimes SQL Azure is not a good choice (costs-wise). For example, if I have a large data warehouse (50-75 gig), I would strongly reconsider surfacing that content in Azure directly in SQL Server...the costs per month would be astronomical. I would consider a NOSQL database or not move the data warehouse to the cloud.
I know this might be an obvious one, but remember you are not only paying for storing your content in the cloud...you also pay a very small amount each time someone access it. On a very busy site with lots of images, icons, scripts etc. this can add up very quickly. Having the content pulled from the web compute role will drastically lower the costs of accessing other storage mechanisms such as BLOB or Queue storage.
Two types of caching:
- Server content caching: This content is cached on the server, therefore the content does not have to be retrieved from a SQL Azure, BLOB Storage or from another remote location that is not on the local server. For example, caching the same results in memory instead of performing the same SQL Server t-sql query will save costs because you are mitigating the number of transations from the SQL Server to the web server.
Use the Enterprise CDNs for Scripts (i.e. jQuery, Ajax)
(I am not talking about the Azure CDN, which is a different topic). Microsoft and Google both provide hosted access to things like jQuery. Instead of having that script downloaded from your Azure web role, the client browser or mobile device downloads it from Microsoft or Google directly. This saves you both transactional and bandwidth costs. Here is a good article describing
the pros/cons of both. Putting those scripts on Microsoft's or Google's network will decrecy the network latency of the calls and also allow your pages to load faster (since client browsers can only make a limited amount of requests to the same domain). The main benefits are described in this article here
Use the RIGHT VM Sizes
Azure includes several different VMs you can use to deploy your web or worker roles. Ensure that you pick the right one for the job. For example, Microsoft positions the "Extra Small" VM as a way to test code and not really meant for production. However, that role is perfectly OK for running a blog, small corporate site, a restaurant site etc with no problems. I am running my www.silverlightbusinessintelligence.com
site on the Extra Small instance and it works really well and have no need to pay for a more expensive VM.
- Note: Remember that the defaults and best practices Microsoft perscribes are not necessarily what is needed for you and there are lower options available. You can always quickly scale higher as you need more horsepower. There are techniques to poll every minute your CPU/Memory utilization to determine if you need a better cloud VM infrastructure.
Multiple Web Sites Per Web Role
In the Azure 1.3 SDK update, now you can host multiple web sites per single web role. For example, if you have a Medium VM you might be able to put on 3 or 4 different web sites per single web role. This will obviously cut down costs as you are not paying for 4 different VMs just one. The Windows Azure Platform has detailed instructions on how to support this here
- Note: Architecturally you can also stagger different sites for traffic reasons (according to year/time of day/week etc). For example, if you had an tax website (high traffic beginning of the year) and place that with a web sites for NFL Football (popular towards the end of the year).
Use IIS 7.x HTTP Compression (dynamic and static content)
In Azure, you have a choice to deploy to either an Windows 2008 SP1 or Windows 2008 R2 Server. Both servers use IIS 7.x as the web server, which makes configuring things like static compression or even dynamic compression pretty easy. This will save you a lot of money on larger sites, since most of the web traffic is string based that can be compressed with dramatic ratios.
- Note: It appears in either the new Azure SDK or the new VM image, IIS compression is turned on by default for dynamic content. For example, in order to have my web site (silverlightbusinessintelligence.com) to take advantage of IIS 7.x compression..I did not have to do anything. However, keep in mind that if you take full control of your serialization, media formats or APIs etc. you will have to configure IIS Compression.
In this article I showed you different tools, promotions and technology architecture choices you can use to lower the costs of using the Azure Cloud. Remember that every service you choose to use from Azure has a cost associated with it.
- Plan using the Azure Platform Pricing Calculator
- Look at the available promotions and offers.
- An offer may not include everything, but it can dramatically subsidize the costs of doing business in Azure
- Architectural decisions can end up costing you a lot of money