In the previous article in this series I introduced the Windows Azure Platform and described the three basic components of Windows Azure, the Compute and Storage services and the Fabric Controller.
Let’s now take a look at how Windows Azure scales out.
The windows Azure Compute Service can run many kinds of applications. The primary purpose, however, of the Windows Azure Platform is to support applications that have large numbers of simultaneous users. After a while scaling-up, using bigger and bigger machines to support more and more users, is no longer possible. So Windows Azure is designed to support applications that scale out, using multiple instances of the same code running on multiple machines.
To accomplish this, a Windows Azure application can have multiple instances, with each instance executing in its own virtual machine (VM). Each VM is provided by a hypervisor (based on Hyper-V) that’s been modified for use in Microsoft’s cloud, and it provides a Windows interface to the instance it contains.
Figure 1: A typical Windows Azure Application Running on Multiple Virtual Machines |
|
Windows Azure currently supports two instance types – a Web Role Instance and a Worker Role instance (Figure 1).
As its name suggests a Web Role can receive incoming HTTP or HTTPS requests and a Web Role instance includes IIS7 to provide this support. Developers can use ASP.NET in the Web Role but they are not restricted to this technology – PHP or other web technologies can also be used.
Worker roles are similar to Web Roles but they do not have IIS7 installed and so they cannot receive Web requests (HTTP or HTTPS) directly. They are usually used to process background tasks.
A Windows Azure Application can consist of all Web Roles or all Worker Roles but typically will be a combination of the two. If an applications load increases more instances can be launched, depending on the load this may mean more Web Role instances, more Worker Role instances or both. If the load then decreases the extra instances can be stopped.
In a production environment this is managed through the Windows Azure Portal. In a development environment the developer can configure the initial configuration by modifying the properties of the Cloud Service.
If we go back to the “Hello Cloud” Application we created in the first article, we can see that in the HelloCloudService project there is a Roles folder which contains a single “Role” – the Hello Cloud Web Role, that is the other project in the solution (Figure 2)
Figure 2: The Hello Cloud Solution in Solution Explorer |
|
If we right-click on the HelloCloud role in the Roles folder, and select Properties, we can configure this Role.
Figure 3: Configuring the Hello Cloud Web Role |
|
We can set the size of the VM and the number of instances to launch, when first deployed. The VMs can be Small, Medium, Large or Extra Large. Each type has a different number of CPU cores, system RAM and local Storage – see http://msdn.microsoft.com/en-us/library/ee814754.aspx for the exact configuration of the available VMs.
In a multi-Role Application, each Role can be separately configured and customized for the expected demand, and once launched the Windows Azure Portal can be used to add or delete running instances according to demand.
In the next article we will take a look at the Storage Service and how that can be used in Windows Azure applications.
953c6e68-0551-4d87-b040-71bf0e9fda4a|0|.0