Azure: Sites, roles and services
As windows Azure continues to grow from a new PaaS offering to a fully features IaaS platform, the range of services on offer continues to grow. With this in mind it is becoming increasingly difficult to differentiate between the different ways of hosting your code in Azure. This post outlines the four different options at the time of writing, two of which comprise the Azure cloud service offering and the other two remain standalone services.
In order to understand these, two key concepts need to be defined:
Platform as a Service = Provides a layer of abstraction in a cloud environment whereby the consumer need only worry about the code, configuration and deployment. The provider (in this case Azure) managed and maintains the network, servers, security and storage.
Infrastructure as a Service = The rawest and most basic form of cloud computing, IaaS provides access to physical or more commonly virtual hardware in the form of Virtual Machines. Once provisioned, the VM and its underlying operating system remain the responsibility of the customer. All facets of its operation including storage, security, maintenance and monitoring are handled by the customer. This provides excellent control but with it a much higher maintenance burden.
The main Azure code hosting choices are:
Web Role (Cloud Service)
A web role allows you to host your code inside an Azure cloud service meaning your site can scale to almost any size very, very easily. When Web roles are employed alongside worker roles and other services such as Azure Service Bus, they offer the most complete means of building modern cloud architectures on the Microsoft stack.
Worker Role (Cloud Service)
Worker Roles are headless servers that perform continuous processing without ever surfacing a front end. Typical scenarios for worker roles include processing data from service calls, processing messages off a queue or perform other blocking executions that you wouldn’t want tying up your front end.
In both web and worker roles the Azure platform will still manage the underlying operating system on your behalf, but the code needs to be aware that this is happening and provision for scenarios where such maintenance may take an instance offline. Unlike Azure Websites (see below) this isn’t taken care of automatically.
Azure websites is the newest PaaS offering that offers a ‘fully managed’ VM environment. The Azure platform manages and maintains the underlying operating system, installing updates and performing routine maintenance meaning you only need be concerned with your code and not the platform. The platform also manages the migration of your site from one host to another so that if the underlying host fails or is recycled for maintenance, no downtime is witnessed and no data is lost.
Web Sites offer a range of hosted languages including the full .net stack, PHP and Node
The VM offering gives the ultimate control – you spin up a VM and its yours thereafter. Much like creating an EC2 instance in AWS you are free to do with this machine anything you like. You are therefore responsible for OS updates, monitoring uptime and availability, scaling and all of the other goodness that PaaS gives you over IaaS.
With the freedom offered by a VM comes options – now you can run any language on the Windows platform, so things like Ruby, C, C++, Python etc. are all possible but you’ll have to install and set up all of this yourself.