DavidAiken

Windows Azure Development

Follow me on TwitterRSS Feeds

  • Home
  • About
    • Bio
image.png

Web Queue Task Queue Task

Apr 12th

Posted by DavidAiken in Windows Azure

2 comments

As part of my firestarter talk on building applications from the cloud, I talked about decoupling the tasks worker roles had to perform using Queues.

Here is the basic pattern:

Web Q Task Q Task diagram

This is a pattern you should follow when building new applications and services for the cloud.

Why should you think this way?

There are several reasons:

  1. De-Normalizing data for Windows Azure table storage. If you are using table storage, you could well be using a worker role to keep the data de-normalized. As an example, in the Bid Now sample application there is a view of the data that is the most viewed items. This table is updated by a worker. When you view an item on the site, a message is placed on a queue which instructs the worker to update the data in the most viewed items table.
  2. Scale out. Some tasks take longer and/or more resources than others. Some tasks need to be done quicker than others. As an example, it doesn’t matter how quickly we update the most viewed items table, but we had better update the table containing the winning bid very quickly. Breaking out tasks into different workers allows you to scale up and down in the right place.
  3. Failover. At some point, your worker will effectively restart. (could be hardware failure, OS patching etc.) The more work a worker has to do in any one task, the longer it will take to redo this after a failure. It also has a much greater chance of leaving your system in a mid-way state.
  4. Isolation/Layering. You can easily add improvements and deploy fixes into individual instances if they are separated out without any down time.

This has to be the first rule of building cloud apps, but what about a sample that shows it?

If you look at the Bid Now sample app, you will see that although we have a single worker role – the app is in fact implemented using the strategy above. We use a single worker as I didn’t figure you would want to run 6 worker roles for a sample app!

If you want to walk through an example of this, take a look at the following places in Bid Now:

  • Buy/AuctionDetails.aspx.cs in the project BidNow.Web, line 164-168. If the item is viewed, call service.IncreaseAuctionItemViews, which if you follow the link will take you to
  • AuctionService.cs in the project BidNow.Services, line 266-269. Here we add a message to a queue.
  • ViewItemHandler.cs in the project BidNow.Handlers, starting at line 51, reads the message from the queue and increments it up the list. It performs a delete and an add to do this as the view table is ordered by the partition key (more on this in a later post).

You can grab the latest Bid Now Sample from http://code.msdn.microsoft.com/BidNowSample.

THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Bid Now Sample, Windows Azure

Windows Azure FireStarter Deck

Apr 9th

Posted by DavidAiken in Windows Azure

A couple of folks have asked about my deck from this weeks event, so 

here it is

THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Deck, FireStarter, Windows Azure

Cloud Cover Episode 8 – Shared Access Signatures

Apr 9th

Posted by DavidAiken in Windows Azure

The latest episode of Cloud Cover is now live on Channel 9 at http://channel9.msdn.com/shows/Cloud+Cover/Cloud-Cover-Episode-8-Shared-Access-Signatures/, or watch it below.

The guys are taking a 2 week mid-season break, but will be back soon.

Get Microsoft Silverlight

THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Blob Storage, CloudCoverShow, Windows Azure
image.png

New Bid Now Sample on Code Gallery

Apr 8th

Posted by DavidAiken in Windows Azure

2 comments

I’ve just posted the latest version of Bid Now on code gallery at http://code.msdn.microsoft.com/BidNowSample! On code gallery you will find the code, as well as some guidance on how to get Bid Now running on your machine, as well as how you can deploy it to the cloud.

A few days back I presented at the Windows Azure fire starter event here in Redmond. (More on that in a few days when the videos are posted.) This is one of the demos I showed during my talk.

The demo is built on Windows Azure, and uses Windows Azure table and blob storage for data. There are some great things to look at in the code, such as the decoupling of functionality and use of Windows Azure Queues. It is also a great example of how you can build complex data applications using Windows Azure table storage. Think nosql here.

If you look at the homepage you can see there are several “views” of the data. As an example the boots below are shown in both the “Bids ending soon!” and “Hottest” sections. This data is pulled from different Windows Azure tables as all the data has been de-normalized.

image

Over the next few days I’ll be posting more details on how we built this app, some of the do’s and don’ts as well as how you can use it for your own demos/projects.

THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Bid Now Sample, nosql, Windows Azure

Cloud Cover Episode 7 – Dallas

Apr 2nd

Posted by DavidAiken in Windows Azure

Cloud Cover Episode 7 is now available on C9 at http://channel9.msdn.com/shows/Cloud+Cover/Cloud-Cover-Episode-7-Dallas/, or watch it below.

In this episode Dunn & Marx cover:

  • the new information marketplace for producer and consumers called Codename "Dallas"
  • A PowerShell one-liner for monitoring your instances in Windows Azure.
  • How to build and deploy to the cloud from Visual Studio using MSBuild tasks – all automated!

Get Microsoft Silverlight

 

THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS

CloudCoverShow, Windows Azure
« First...«23456»10...Last »
  • Twitter

    Loading tweets...
    Follow me on Twitter!
  • Recent Posts

    • Manage Your SQL Azure databases with Project Houston
    • How to deploy an ASP.NET web site to Windows Azure!
    • Getting Started with Windows Azure
    • Windows Azure Architecture Guide – Part 1
    • Speed up your workers with .net 4.0 parallel extensions
    • Windows Azure Platform Training Kit – June Update
    • Security Best Practices for Developing Windows Azure Applications
    • Remember to update your DiagnosticsConnectionString before deploying
    • address is not the same as Address
    • Windows Azure Firestarter on Channel 9
    • Yorkshire Puddings Recipe
    • Design to fail
    • Scaling out Azure
    • Remember to check your framework version
    • De-Normalizing your data
  • Search

  • Cloud Tag

    .Net 4.0 .NET Rocks API Best Practices Bid Now Sample Blob Storage Busy Channel 9 CloudCoverShow Cloud Patterns Customers Deck Fail FireStarter Getting Started nosql Parallel Project Houston Rant Scaling Out Security SQL Azure Table Storage Tip Training Kit Visual Studio 2010 Express Vittorio Windows Azure Windows Identity Foundation x509 Yorkshire Puddings
  • Blogroll

    • .Net Services Team
    • Azure Tribes
    • Clemens Vasters
    • Ryan Dunn
    • SQL Azure Team
    • Steve Marx
    • Vittorio Bertocci
    • Windows Azure Team
    • Zach Owens
  • Posts by Month

    • July 2010 (4)
    • June 2010 (3)
    • May 2010 (2)
    • April 2010 (11)
    • March 2010 (1)
    • February 2010 (1)
    • January 2010 (4)
    • December 2009 (2)
    • November 2009 (2)
    • October 2009 (2)
    • September 2009 (3)
    • August 2009 (4)
    • July 2009 (1)
    • May 2009 (2)
    • April 2009 (1)
    • February 2009 (3)
    • January 2009 (1)
    • December 2008 (3)
    • November 2008 (4)
    • October 2008 (3)
    • June 2008 (3)
    • May 2008 (2)
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top