This IS Azure Coding After All

Today’s post is going to take a decidedly different angle. I’m going to actually talk about coding for Windows Azure. I know, I know. After two years of posts with nary an Azure sample in sight, why should I start now? I feel that now more than ever, making the decision to leverage the Azure platform is for all practical purchases a non-decision. Creating an application to deploy to Azure is as easy as creating an application to any other webhost. In some regards it’s easier.

What prompted me to take the plunge was Code Project’s Azure DataMarket Contest. After looking around at the available datasets, I came across the Stats, LLC NFL and MLB Stats feeds. I’ve wanted to learn ASP.NET MVC3 for a while, and make a Windows Phone App while making a program that takes advantage of all that Azure has to offer…I can’t find much better than an NFL Statistics app. (It also might give me a chance to learn some data-mining/data warehousing skills). Not to mention there was a nice prize involved.

So without further ado, let me introduce Pigskin:

newpigskin

Right now Pigskin shows NFL game by game statistics from the Azure Datamarket. The only data currently in place is from the 2010 season. I will be adding MLB Live and Game By Game stats as well soon (and perhaps changing the name since Pigskin doesn’t really make sense when talking about baseball). Rather than pulling data on each request and formatting it, I currently dump the data into a SQL Azure database and use Entity Framework queries to pull the information into a format ready for consumption by the web page. Because of the generic nature of the data structures, the queries take some time to run so I’m adding code to take advantage of the AppFabric Caching service and will also use the Azure Table Storage to dump the views into a format that is de-normalized and more efficient for reading.

The interesting thing is how rapidly I have been able to iterate and add features to the site using the Microsoft stack:

  • ASP.NET MVC 3
  • Entity Framework 4.1 Code First API
  • Windows Azure
  • SQL Azure
  • Azure Datamarket
  • Azure Blob Storage
  • Azure Table Storage

Case in point here is one of the earlier versions of the same Game Details screen

oldpigskin

You can see it was very much a vanilla ASP.NET MVC site and I had only exposed a few key points of data. I went from this page to the new design very rapidly. This included updating the color schemes and layout and displaying more data from the database. Interesting fact, I didn’t change the schema at all between the two revisions, and the new version gets all of its data with a single query.

I will be making the code for Pigskin available under the MS-PL so that the community can see the guts of the application and learn how to leverage Azure for their next great app. I will update this post when I make the code available. I will also be following up with a series of blog posts discussing various aspects of the application.

Published Monday, April 18, 2011 5:42 AM by Mike Brown

Comments

# IQueryable<T> and IUnitOfWork Revisited

So I’m on a pretty cushy government contract (turns out that if you want to have a low stress job

Wednesday, May 25, 2011 6:44 AM by Brownie Points

Leave a Comment

(required) 
(required) 
(optional)
(required)