Touching the clouds with Microsoft Windows Azure

Updated on 31-Oct-2014

Cloud platforms are the way to go nowadays if you are creating a new web application, and everyone and their grandpa seem to be moving to services such as Amazon Web Services or Google App Engine (GAE). Microsoft too has entered the market with its Microsoft Windows Azure service.

So what is Azure and how does it stack up to your needs?

Microsoft Windows Azure is a cloud computing Platform as a Service which allows you to create highly scalable  web applications. Application which you create using the Microsoft Windows Azure tools are run on multiple instances on Microsoft's data centres and can easily be scaled by launching more instances of the application.

Microsoft's offering is essentially composed of three components, Compute, Storage, and Fabric. Any web application you create will run on Compute service, which can store and access data from the Storage service. The Fabric Controller is what manges instances and allocates resources.

Developing for Microsoft Windows Azure

Microsoft has released tools for creating application for the platform using Visual Studio 2008, and is working on providing tools for non-Microsoft languages too. Support for development with PHP using the free Eclipse PDT is underway.

That said, this being Microsoft, the Azure services and platform still run on Windows and use Microsoft technologies and applications such as IIS. However it is not necessary for you to do the same. Microsoft provides libraries for its .NET platform to simplify your job, but you can create application in Ruby, Java, Python or even PHP if you wish! No Apache and MySQL for you though.

The code you write will be run in VMs running a 64-bit edition of Windows Server 2008, however you need only manage your code and upload it via the Microsoft Windows Azure interface. You do not need to manage the VM itself like you might on Amazon EC2. This also means that you cannot load a VM image of your own choice, the only thing you need to worry about is the platform and the code. You need to upload your application and specify how many instances to run, and Azure will launch and manage them for you.

In Microsoft Windows Azure your application scale by launching multiple instances instance of scaling the compute power of the machine itself. Your application need to be written to take this into account and advantage of it. The applications you write need to be stateless, as given multiple instances, it is not necessary that multiple request from the same client will be handled by the same instance.

The Microsoft Windows Azure services have, as mentioned before, three parts you need to be aware of, Computer, Storage and Fabric. You application can use Compute for running your application, Storage for storing data, and Fabric for monitoring your application.

Windows Azure Compute service

Microsoft Windows Azure provides two different roles for Compute instances based on the needs of the application being developed; the Web Role and the Worker Role. The configuration of the VM running the application will depend on the role.

An application configured for a Web role will run a VM which has IIS 7 (Internet Information Services) server installed. It will handle HTTP requests and serve content. Your clients can connect to this server and request resources pretty much like any other IIS7 hosting solution. Note that the application needs to be stateless, and as such any session information etc. should not be stored on this server, as it is not necessary that the same instance will be handling all the requests from one client.

An application configures in a Worker role, will be running on a different VM configuration. Such instances will not be accessible from the outside. Which is to say, they wont serve content directly. For servers handling and processing a large amount of data these servers can be used to asynchronously process such data. For example, a video hosting website could use these servers to asynchronously encode the video content uploaded by the users to the formats that such a website can stream.

An application can also be configured for both the roles.

As the load changes, one can launch more Web or Worker instances to meet the demand. Since the storage on these instances is not persistent, it is important to store any data elsewhere, such as the Microsoft Windows Azure Storage service, which is detailed next.
 

Windows Azure Storage service

For data storage needs, the Microsoft Windows Azure platform includes the Storage service. This service allows for three kinds of data storage; Blobs, Tables, and Queues.

Blobs in the Storage service allow for storing large chunks of data, which can be as much as 50GB in size. These can store binary files with associated metadata (artist information for an MP3 file, tags for an Image etc.) and have a simple hierarchy where a storage account can contain one or more containers which can contain one or more blobs.

For more structured applications, you can use Tables, which despite what their name might suggest to you are non relational. The data is stored in the form of entries with associated properties.

Queues are another form of data storage but are intended to be a means of communication between instances. Taking the example given above of a video streaming application; any time a user uploads a video to their account while interacting with the Web role, a Queue item describing the task could be created. One or more Worker instances can then iterate over the Queue and process these tasks, information on completed tasks could be added in another Queue such that users can notified that their videos are done encoding.

Data access in the Microsoft Windows Azure Storage service is easy to access using Microsoft's libraries, or even raw HTTP in a RESTful manner. The data stored is fault tolerant, as it is instantly replicated three times.

Finally, the fabric controller gives applications access to the minute-to-minute details of a collection of web and worker instances. It is responsible for launching and monitoring instances, and ensuring that a new instance is started to replace one which has ended / crashed.

 

Stacking Azure with GAE and AWS

Amazon and Google have been in the Cloud hosting department much longer, and only time will tell what kind of performance Azure has and how feasible it is.

Since Google App Engine, Amazon Web Services and Microsoft Windows Azure platform all work is quite different ways it is impossible to compare them directly. Without knowledge of the application in consideration, it is difficult to estimate which one will be better.

However on comparison some points to become clear:

Microsoft Windows Azure v.s. Google App Engine
 

  • Azure supports more languages than GAE. GAE only supports Java and Python natively, while Azure supports .NET languages, Java, Ruby, C and PHP.
  • For small applications or for application which do not expect much hits, GAE is much better, since it provides a limited free quota which will suffice for many applications
  • GAE bills you based on used CPU hours while Azure bills you for used instance hours. What this essentially means is that while Azure will continue charging you for running your application even when it is not being used, or is not being used to its full capacity, GAE will only charge you for the actual CPU resources consumed.

Microsoft Windows Azure v.s. Amazon Web Services
 

  • Amazon allows for much more flexibility by allowing you to use your own virtual machine image for your instances.
  • Amazon instances for Linux cost lesser than Azure instances.
  • Amazon instances are virtual machines fully under your control, as such you can install current application there without modification, and they will run.
  • Amazon allows for much more control over the configuration of instances

 

Connect On :