Azure FAQ: Part I


In case you do not want to read the complete article , here are two videos which we have recorded for the same. Video1 and Video2.
 Introduction and Goal

Different people have different obsessions and I have this stupid obsession of writing articles in FAQ formats :-) . The more I try to write articles in normal format I end up with a FAQ. My only thought process of writing articles in FAQ format is that we end up talking to the point rather than talking about trees and rivers , many may disagree.
 
Carry my obsession one more step ahead Windows Azure FAQ part I.
 
Here's my small gift for all my .NET friends , a complete 400 pages FAQ Ebook which covers various .NET technologies like Azure , WCF , WWF , Silverlight , WPF , SharePoint and lot more http://www.questpond.com/SampleDotNetInterviewQuestionBook.zip  

Thanks , Thanks and Thanks

I am really blessed to be part of Lionbridge SaaS team, the knowledge they brought within me about SaaS is incredible. I would not be writing this article if I was not the part of the team. Here's nice article from the same team on SaaS http://www.lionbridge.com/lionbridge/en-US/kc/product-engineering/configurability-in-saas.htm .

The article by Modesty zhang really inspired me to write this article, here's a reference http://www.codeproject.com/KB/silverlight/Azurelight.aspx , thanks for bringing the Azure interest in me.


This does not look like a technical article?

At the initial stages of FAQ we will get acquainted to general vocabularies of Azure and then we will start with all programming stuff.

Quote: - Windows Azure is not a technological change, it's a business change: - Shivprasad koirala (taking some space to glorify myself J )

If you really ask me Azure is 20% technological driven and 80 % business driven. So if you or your organization is thinking of migrating to Azure, the decision will be management driven rather than technology driven. So the initial stage of the article will talk about cost and need to use azure which will be a bit boring. As this FAQ series moves ahead you will see lot of samples codes, architecture thought process and all the technical blah blah.
I am sure as technological person you need to be aware of how to convince the management when you want to implement a new technology.
 


What problem does Windows Azure solve?

The best way to define Azure is by understanding what problem it solves. So let's take a typical organization that has a separate IT department maintaining an online web application. Now let's try to analyze which different cost factors are involved in maintaining a web application online.

We can divide IT department cost in to four broader sections:-

  • Hardware cost: - If you want to host your web application you would need servers, routers etc to run your application.

  • Software licensing cost: - When you make your application you will need to purchase server OS license like windows 2003 server, visual studio licenses, SQL server licenses etc.

  • Hosting cost: - You also need to deploy your web application on internet. For that you will need to host your web application on some hosting service. One of the biggest costs in hosting service is bandwidth. So we need to budget for the same.

  • IT personnel salary: - Nothing can be run without humans. So we also need IT personnel's to do development and maintenance of code and infrastructure.

In other words there is a considerable cost attached to run an IT department. Many of these costs need to be paid up front.
 


1.jpg
The upfront cost can be solved if we can get a provider who can host a shared service which provides shared server hardware, shared software license cost and can provide pay per use bandwidth. The provider can maintain a team of IT personnel's who can maintain the infrastructure. If the provider services not one but many organization using this shared service it can bring down the cost considerably.

So in other words the model changes something as shown below. So the provider moves all the hardware and software on a centralized location and the applications of the respective organization are hosted in this shared environment. Using this model organizations do not need to pay upfront for the hardware, software and IT personnel costs.


2.JPG
In one line to define Windows Azure, Microsoft is the provider and windows azure is the shared hosting service.

Microsoft has provided his own datacenters where they have hosted software's like SQL services,.NET services,Sharepoint services,Microsoft dynamic services and live services. Microsoft azure provides a cloud environment for running your web application and storing data. Its like visualizing windows services available on cloud.
 

3.jpg

Courtesy: - The above image is taken from the white

An Introduction to Microsoft® .NET Services for Developers: - The .NET framework for the cloud by Aaron Skonnard, Pluralsight. You can read the white paper from http://go.microsoft.com/fwlink/?LinkID=150833 .
 

Isn't it friends, sharing cuts down cost

4.jpg

How is billing and costing done in Windows Azure services?

As discussed above there are two types of cost one is the fixed cost (server hardware, employee salary etc) and other is the variable cost (bandwidth usage, hosting storage space etc).

Windows Azure services are billed using pay and use model. Microsoft terms this as consumption based model. In other words the customer does not need to pay anything upfront, everything is paid as per consumption.

The pay and use model is defined by four characteristics:-
  • Compute / Hour: - Depending on how much computing power your application uses you will be charged. When I wrote this article it was $0.12 / hour.

  • Storage in GB / month: - Storage is measured in units of average daily amount of data stored (in GB) over a monthly period. The storage cost currently is 0.15$ / GB stored for the whole month. Let's try to understand the above statement. If you store 30 GB for a day then the average comes to 1 GB per month. If you stored 30 GB for 30 days then average come to 30 GB per month. Below are the calculation details :-
     


    5.JPG
    Figure :- Storage calculation details

  • Bandwidth: - One more factor which is used to measure cost is bandwidth, in other words how much data goes in and out from the data centre. We will discuss on the bandwidth cost in more detail later because this has lot of variations depending on the services provided by Azure. Please note bandwidth used within data centre is free.

  • Storage Transactions: - Any kind of add, update and delete on the storage data is also tracked. Currently it's billed at $0.01 for 10,000 (10k) transaction requests.

The charges mentioned in this article can be obsolete as time passes by, for recent rate card please visit http://www.microsoft.com/azure/pricing.mspx 

We are still not clear with the payment model it looks a bit confusing?

There are three parts to the Azure payment model:-

Metering: - This defines the unit of measurement. For example compute per hour, storage per GB, bandwidth per GB and transactions per 10k.

Billing: - This defines the dollar amount for the unit.

Services: - Both metering and billing needs to be associated with a service like .NET service, SQL Service, Live services etc.
 


6.jpg

The charges mentioned in this article can be obsolete as time passes by, for recent rate card please visit http://www.microsoft.com/azure/pricing.mspx

  Windows Azure SQL Azure .Net services
Bandwidth IN $0.10 / GB $0.10 / GB $0.10 / GB
Bandwidth OUT $0.15 / GB $0.15 / GB $0.15 / GB
Storage $0.15/GB stored/Month NA NA
Transactions $0.10/10000 K NA NA
Messages NA NA $0.15/100K message.

A note of SQL Server cost

Web Edition – Up to 1 GB relational database = $9.99 / month
Business Edition – Up to 10 GB relational database = $99.99 / month


What is Fabric?

Before we start to answer this question, let's thanks Steven Nagy for helping us understand this terminology http://azure.snagy.name/blog/?p=84

As said before Microsoft has his own datacenter's where they will have number of server's running windows 2008 servers.


Note: - While I was writing this article what I understand is that currently they have one data centre in US west coast which hosts Windows Azure application.
 
The whole concept of Azure is to give decent hosting rates to the end user. So Microsoft has to somehow share his hardware across multiple applications.

In order to share the physical hardware across multiple applications, Microsoft used 'Hypervisor'. Hypervisor is a modified version of Hyper-V. So hypervisor can help you to create virtual machines from those physical hardware servers. You basically end up with a cluster of nodes which can have virtual machine or hardware's.

If you really expand these rectangle nodes you end up in to a Fabric like structure.
 

7.JPG
Figure: - Fabric
 

So now let's define fabric. It's nothing but a cluster of nodes. These nodes can have physical machines or virtual machines.

8.JPG

Where does our application run?

Our application run on the fabric nodes and each application gets its own virtual space resource. We will discuss about the same in more detail as we move ahead in the FAQ.

What is a fabric controller?

Fabric controller is the heart of the Azure fabric system. It manages complete life cycle of Azure services. Below are some important roles which Fabric controller plays:-
  • Manages provisioning for the application. As per application needs fabric allocates CPU , memory and bandwidth limits.

  • Deploy the services.

  • Monitor system status and health. See that it satisfies the SLA's defined.

  • If there are failures recover from the same.

What are roles, web role and worker role?

Roles are nothing but applications or components. To define the same in other words they are actually the application code. Windows Azure categorizes application in two categories one is the web application and the other is the worker application.

Web role / Web application: - A web role is a Web application which can be accessed via HTTP. A web role can be hosted as a subset of ASP.NET and Windows Communication Foundation (WCF) technologies.

Worker role / Worker process: - A worker role is a background processing application somewhat similar to a windows process. A worker role does not communicate directly with external the world. In other words it does not accept requests directly from the external world.

So is it that worker role cannot connect to external systems outside Azure?

Yes, worker role cannot connect take inbound calls from internet but it can make outbound calls. A worker role is background processing process so it does not have incoming internet requests. Worker role also has access to queue services. So that can be one more communication point where external systems can post data and worker role can read from the same. 

9.JPG
Figure: - Worker and Web role


Is it that every web and worker role is hosted in their own virtual machines?

Yes, every web role and worker role are hosted in their own virtual space or we can say in their own virtual machine. Fabric does not allocate IIS for worker role virtual machine. 

10.JPG
You can see from the above figure how fabric controller uses the data centre hardware and creates new VM. Our application runs in those virtual machines. So if it's a web role fabric controller will create a new VM instance with IIS and your web role instance. If it's a worker role then it will create work role instance only. It will not provide IIS instance for worker role as its not supposed to take inbound calls from external world.


How do the web role instance and worker role instance communicate with fabric?

Every virtual machine has an agent. This agent facilitates communication between web and worker role instance with the fabric.

11.JPG
What are blobs, tables and Queues?

Till now we have only discussed about application code. With application you also need to save data. Windows Azure has three kinds of data blobs, tables and queues.

Blobs: - They are used to store large objects like images, audio, video etc.
Tables: - They are used to store durable and scalable data structure. Tables consist of entities and entities have properties.


12.jpg
Figure: - Table structure
 

Queues: - Queues are used enable asynchronous communication. They are enabled to store transient data in form of messages. Azure uses queues to communicate between different entities. For instance of a worker role and web roles wants to communicate they use queues.

We will be discussing the above 3 things in more detail in the coming FAQ series. We will be dedicating each one of them a complete FA series. Till then hold your breath.

So is SQL is the standard way to query blobs, tables and queues?

No we cannot use standard SQL to query the above azure storages. They are accessed through REST (Representational state transfer). REST is a style of software architecture distributed systems. So if you want to read a data from a table you need to specify the below URL.

http://%3C%3CWebsiteWhereTableisHosted%3E%3E/%3CTableName%3E?$filter=<Query

The first is the website on which the table is hosted , second is the table name and then your query.


Why was not SQL preferred?

REST relies completely on HTTP protocols which enables other languages like PHP.JAVA to communicate with Azure storages. In other words you can build your application using any language like CGI, PHP and have your data stored in Azure storage.

Why one more data storage we already has SQL Server?

Windows azure will be used a common hosting platform so that cost of hosting is less for customers. So the storage should be highly scalable. In order to support these kind of requirements we need to scale out and not scale in. Windows azure storage is built on scale out architecture.

How do web role and work role communicate with each other?

Coming soon....

What is a fault domain?

Coming soon....

References