Windows Azure - Part 1 - Overview

In this blog post, I will cover the basics of Windows Azure and cloud computing. 
Cloud Computing: Cloud computing is about abstracting out the infrastructure needs for your application. So that you don't have to worry about scalability, server management, patches, updates etc. You also pay for the resources you use.
Windows Azure consists of 3 components -
  1. Compute - consists of the VMs that have high computing capacities
  2. Storage - for storing images/large files etc
  3. Management - an API to manage the needs for your application
SQL Azure provides all the SQL database capabilities in a highly scalable manner.

At the first level, we have Loadbalancers which assist in scaling. The second layer is called Fabric. This consists of server instances that are running your application. They can have Web roles or Worker roles. The fabric layer talks to Storage layer via another set of Loadbalancers. The storage layer consists of tables, blobs etc. There is one another component which cuts across multiple layers. This is called Fabric Controller. This is the controller that manages the whole environment. If one server goes down, Fabric controller chooses another one so that the application is not down. This is the advantage that we get from cloud computing.
So, I went ahead and added a windows azure project with one web role, one worker role. 

Web Role: 
  • Web role provides a web front end for our application.
  • WebRole.cs file provides the entry point for this web app. Here we can override the OnStart() etc methods.
  • These methods are called even before the Global.asax methods.
Worker Role:
  • Worker role is similar to windows service in the sense that it is running in the background and it can listen to events or it can poll and execute certain tasks.
  • WorkerRole.cs file provides the entry point to this worker process.
  • Here you can override the OnStart(), Run() methods etc.
  • The Run() method consists of a while (true) statement. It is in this while loop that we can write our code for the worker process to execute.
Windows Azure Project:
  • This project provides the cloud settings for the roles mentioned above.
  • Here you can control the number of instances, size of VM, settings, certificates, Virtual networks, storage etc.
  • The difference between these settings file and web.config is that you can make changes to these settings file and they will be picked up by the web role or worker role automatically. In case of web.config, you need to deploy the new web.config and restart IIS or redeploy the app for the changes to take effect.
When you run this app, a package is created and then deployed. The website starts to run but the point to notice here is that the website is not running in your IIS or localhost but in another environment called developer fabric. If you see on the right lower side of your screen, you will see that 2 small icons for Compute emulator and Storage emulator have appeared. If you look at these emulators you can see the trace logs, the state in which instances are and can do the monitoring jobs.

No comments: