Tuesday, January 19, 2010

My SQL Azure Bill: Usage statistics like bandwidth and databases

Image credit: KevinSpencer

By using SQL Azure you do not have to be concerned about your backups, maintaince of your SQL Server, creating a fallback scenario etc. You only have to pay for what you are using. This is nice, but what are you using? You do not want to be suprised when the first bill is received. By using SQL Azure you need to pay for:
  1. Database usage. You will be invoiced for the number, type and duration of the database. Type of a database can be Business edition (Up to 10 Gb) or Web edition (Up to 1 Gb). Duration is the number of days the database was available on your SQL Azure server. 
  2. Bandwidth usage. You will be invoiced for inbound and outbound data traffic.
Within your database 2 views are available to get insight information about the Database usage and Bandwidth usage. I can imagine that these views are not so user friendly for your controller, I think he has even no access to these views. But you have at least something.

Database usage view: SELECT * FROM SYS.Database_usage. This view contains information about the number of database of eachtype you have everyday. One database for 30 days will be invoiced for the same amount as 30 databases one day.

Bandwidth usage view: SELECT * FROM SYS.Bandwidth_usage. This view contains the amount of bandwidth usage (in kilobytes KB) per database, per hour, data moving into SQL Azure, data moving out of SQL Azure, data from within Windows Azure and data from outside Windows Azure.

With these usage statistics you can calculate your bill for the coming month.
More detail about billing information can be found here. More details about the billing rates can be found here.
Enjoy using SQL Azure and hopefully you will not be badly suprised about the billing amount.

No comments: