Posts Tagged 'architecture'

Azure for New Projects

I have been hearing a lot of comments lately about Microsoft Azure. Some of what I’ve heard has to do with the perceived pain of migrating existing ASP.NET applications. I know Microsoft says it is supposed to be easy but the fact is that there are some new skills required. Most likely there will be some code changes, even if they are minimal. Additionally there are questions as to the cost effectiveness of using Azure to host a single website for a small to medium business. Whether or not migration of an existing application to Azure is appropriate (both from a business/economic and a technical perspective) will likely remain a subject of discussion for some time.

For this article, though, let’s just consider the other class of applications – new applications – that could be developed for Azure. Certainly there will be new applications developed going forward. Besides the usual differences between PaaS and IaaS, what does Azure give us that an ASP.NET solution deployed to an Amazon EC2 instance, for example, might not?

Most new applications begin with a consideration of architecture. There should be a clear separation between well-defined logical layers. When developing a new application we should almost always be thinking in these terms. Does Azure offer any benefits or options over a traditional solution stack based on .NET, IIS, SQL Server and Windows?

Let’s consider three possible layers in an n-tier model:

  1. The Presentation Tier:
    Well, not really. You will still have to implement this yourself according to the best practices of the particular framework you are going to target. An Azure Web Role will still have basically the same presentation semantics as a traditional .NET Web Forms or MVC application.  
  2. The Business Tier:
    With web and worker roles Azure actually does provide us with a pretty nice abstraction that can help us make a clean separation between presentation and business tiers. Putting the business logic into worker roles, for example, may make sense from both an architectural and a performance perspective.
  3. The Data Tier:
    With Azure we have options on how we could store our data. Do we need the acid properties of a relational database or would an eventually consistent representation of the data be okay for our application? Note that the choice here is directly tied to cost: if we need a relational database in an Azure solution we have to pay extra for it.

We must also consider scalability right from the outset. What is the probability that our application may have to grow to “Internet Scale”? Are we likely to become the next Facebook? What is the downside if we need to scale quickly and cannot? Scale is much more achievable if it is considered as part of the original design.

Azure does offer some attractive alternatives for new application development. If nothing else it should give the system architect an opportunity to think “outside the box”. Azure is a little different than traditional ASP.NET and there is a bit of a learning curve to climb. Consider attending Learning Tree’s Azure programming course to speed your ascent!

Kevin

Application Architectures in Windows Azure, Part 2

So, why would there be a need for different architectural patterns in Windows Azure?

One reason is for scalability. While it is still important to separate storage, presentation and business logic as in n-Tier architecture, we must adopt a slightly different approach if we want to achieve the scalability available to us on the cloud platform. Achieving this same level of scalability on-premises would often require a large capital investment in hardware as well as sometimes complex application enhancements. Further, if demand is not constant over time, much of the additional on-premises capacity goes unused.

On the other hand, a well architected Windows Azure app can easily scale based on requirements. It is this “elastic scaling” (both scale out and scale in) which allows an application to be right-sized depending upon the level of demand it sees. Elastic scalability – from small department sized apps to Internet class applications such as Facebook – is one of the key benefits of cloud computing.

 Enter the “Asynchronous Web Role/Worker Role” Pattern

Arguably the simplest architectural pattern in Azure is the asynchronous web role/worker role. In this basic pattern there are one or more “web roles” and one or more “worker roles”. Azure provides a “Load Balancer” which distributes incoming Internet traffic for us transparently. The storage service provides persistence for our data and also provides a special type of storage (called “queues”) which can be used for communication between the different roles in our application.

Figure 1 The Asynchronous Web Role/Worker Role Pattern

The “web role” communicates with the outside world via the Internet. The web role is the client-facing part of our application. Sometimes (but not always) there is a user interface associated with a web role.

A “worker role”, on the other hand, typically operates behind the scenes. As the name suggests this is code which carries out some task asynchronously. This task may involve processing business logic, writing data to storage or carrying out a long running computation.

Web roles and worker roles communicate with one another via “queues”. A queue is a first-in first-out (FIFO) data structure that allows us to pass messages back and forth between different roles in our application.

It is a bit of an oversimplification, perhaps, but do you notice how web roles, worker roles and storage services can be somewhat similar in purpose to presentation, business and storage tiers?

(Note: Microsoft has enhanced Azure to allow for a greater variety of communication options between roles internally and with the outside world. This basic pattern still is very important, however, and will continue to be the foundation for many real-world systems deployed on Azure.)

Learning Tree’s Windows Azure course will explore web roles, worker roles, queues, storage and more! Doug Rhenstrom, the course author, is developing a hands-on exercise where attendees will build an application that exploits the web/worker role pattern described here. For a short demo of that application please check out this brief video:

You’ll want to attend our Windows Azure course, though, to really dive into the details of how this stuff actually works!

Kevin


Learning Tree Logo

Cloud Computing Training

Learning Tree offers over 210 IT training and Management courses, including Cloud Computing training.

Enter your e-mail address to follow this blog and receive notifications of new posts by e-mail.

Join 53 other followers

Follow Learning Tree on Twitter

Archives

Do you need a customized Cloud training solution delivered at your facility?

Last year Learning Tree held nearly 2,500 on-site training events worldwide. To find out more about hosting one at your location, click here for a free consultation.
Live, online training
.NET Blog

%d bloggers like this: