Partager via


Building Windows Azure Service Part1: Introduction

This is the first of several posts of a walkthrough whose goal is to build a cloud guest book service while exploring Windows Azure basic elements .

I wrote these posts to share my experience in learning Microsoft implementation of cloud computing. If you are new to the technology, my posts can help you to explore and learn about it.

The walkthrough demonstrates the use of Windows Azure Compute and Storage services, specifically:

  • Compute service: web and worker roles.
  • Storage service: blob, table and queues.

The information presented here has been adapted from a related article published on the Channel 9 site. For more information, see Introduction to Windows Azure.

In this walkthrough you will learn how to::

  • Create a Windows Azure service using web and worker roles.
  • Use Windows Azure storage services which include blobs, tables and queues.
  • Deploy the Windows Azure service.

A Windows Azure compute service consists of one or more web roles and worker roles.

  • A web role is an ASP.NET Web application accessible via an HTTP or HTTPS endpoint and is commonly the front-end for an application.
  • A worker role is a background-processing application and is typically found in the back-end.

A Windows Azure compute service may be comprised of one or both types of roles and can run multiple instances of each type. Windows Azure can add or remove role instances on demand allowing an application to quickly and economically scale-up or down when the need arises. For more information, see Windows Azure Compute Service.

Windows Azure storage services provide storage in the cloud, which includes blob services for storing text and binary data, table services for structured storage that can be queried, and queue services for reliable and persistent messaging between services. For more information, see Windows Azure Storage Services.

The following illustration shows the architecture of the Windows Service, called GuestBook, that you are going to build during this exercise .

GuestBookArchitecture

Figure 1 GuestBook Application Architecture

  • A web role provides the front-end that enables the user to view the contents of the guest book and submit new entries. Each entry contains a name, a message, and an associated picture.
  • A worker role that generates thumbnails for the pictures submitted by the user.
  • When the user posts a new item, the web role uploads the picture to the blob storage and creates a new entry in the table storage. The entry contains the information entered by the user and a link to the blob with the picture. The web role renders this information through the browser so users can view the contents of the guest book.
  • After storing the image and creating the entry, the web role posts a work item to a queue to have the image processed in the back-end by the worker role.
  • The worker role fetches the work item from the queue, retrieves the image from the blob storage, and resizes it to create a thumbnail.

What we have described is a common pattern in cloud computing which enables the separation of compute-bound tasks from the front-end ones by using queues. The advantage of this approach is that front and back end can be scaled independently.

Prerequisites

  • The Windows Azure Tools for Microsoft Visual Studio are available on the Windows Azure Tools for Microsoft Visual Studio download page. The Windows Azure SDK is included with the installation, so there is no need to install the SDK separately.
  • You can also install the Windows Azure Tools using the Microsoft Web Platform Installer. The Web Platform Installer simplifies the process of installing and configuring IIS, the Windows Azure SDK, and the Windows Azure Tools.
  • The Windows Azure Tools can be used with these Microsoft products:
    • Visual Studio 2010
    • Visual Web Developer 2010 Express Edition
    • Visual Studio 2008 with Service Pack 1
    • Visual Web Developer 2008 Express Edition with Service Pack 1

For more information, see Windows Azure Tools for Microsoft Visual Studio.

For related topics, see the following posts.