Day 2- Announcing Windows Azure

Technical content of this issue - 4 out of 5

A Word From Our Sponsor

I am here this week due to the largess of FINRA, my current employer. This may be a surprise to folks that thought I was still with NASD - I am. Here's the story - I joined the National Association of Securities Dealers (NASD) in 2002. This is a different company than NASDAQ, which is a stock market for whom I did consulting work in the 90's. NASD formerly owned and regulated NASDAQ (originally this stood for National Association of Securities Dealers Automated Quote system). Mixing the two up was quite common, especially with my prior work with NASDAQ. They are two completely different companies now, as several years ago people started asking about how NASD could own (and profit from) a market that they also regulated. Then last summer, NASD merged with the regulatory arm of the New York Stock Exchange to form a single regulatory organization for the big securities firms. The new joint company is FINRA, the Financial Industry Regulatory Authority. The best part of the new name is I don't need to constantly explain to people that I don't work for FINRAQ. Anyway, without my managers at FINRA sending me here, there would not be a BPN this year.

For all the ExPlural folks out there on the mailing list, I had dinner with Tom Abraham last night. He is doing well and still consulting, only now it is with this company. Go ahead and give it a look - apparently Minneapolis consulting economy is still going strong!

As promised, a shoutout to Marcy Meltzer and Chuck Macomber who identified yesterday's lyric snippet as Frank Zappa's Camarillo Brillo. It's no coincidence that Marcy is also the only other member of my current team who has seen Animal House.  Chuck admits to reading his BPN until he was un-concho.

Mornings in LA

I made sure to leave more time to walk to the convention center this morning than yesterday morning as the sidewalks would be more crowded on a Monday, but when I walked to the convention center about 7:45 am this morning and I was struck by the fact that the only people on the streets are other PDC attendees (don't ask how you can tell, you just can). In downtown New York walking down the sidewalks at 7:45 is like navigating through an NFL line of scrimmage, yet here in LA they apparently get started a little later. I guess they make up for it by leaving work early to watch Monday Night Football at 5:30. Maybe it explains alot.

Force.com was running a promotion this morning where they had about a dozen bicycle rickshaws with sales reps trying to hand out freebies. Unfortunately, we geeks were highly focused on getting to the center and nervous about being approached on the street and they couldn't get anyone to take any of their T-Shirts. It was a marketing disaster. They were also trying to give out coffee mugs with little success. A couple had Krispy Kreme donuts that no one would...wait a minute - I did take a Krispy \ Kreme donut!

Morning Keynote Sessions

The first morning of the PDC gives an overview of the conference and the new technologies that Microsoft is focusing on during the week. This year was no different except for the lack of the frills that normally accompany the kickoff, for instance there was no elaborate video this year. The presentation was also not well structured in that it didn't provide a coherent introduction to the new technologies, at least to my mind. I walked in knowing nothing about "computing in the cloud," and there wasn't a clear, concise explanation up front - I was left putting together my own impression of it based on puzzle pieces I picked out of the various speakers. Here I will just give basic impressions, the various talks throughout the week will fill in more details.

Windows Azure

This is the big announcement of the week, a fact that was clarified when Ray Ozzie put up a slide saying "Announcing Windows Azure" and said "This week we are pleased to announce Windows Azure." At that point a group in the back started cheering like their section had just won free pizza at a ballgame - I'm pretty sure that had to be the Windows Azure team celebrating their redemption from being "the team that must not be named."

In short, Windows Azure is an operating system for the entire enterprise rather than just for a single computer. From what I understand so far, it is not a set of disks that you install in your enterprise, but a hosting service run by Microsoft. Based on expertise accumulated by Microsoft while building and running sites like MSDN, Microsoft.com and Hotmail, it was architected by Dave Cutler of Windows NT and VMS fame, among others. I got much more detail at the talk immediately following the plenary session, which you will find below.

One declaration made by Ray Ozzie that stood out is that Azure is the highest scale, highest availability, most economical and most environmentally friendly way to deploy large cloud apps.

Microsoft Online Services

The next presenter started out by talking about the difficulty of hosting your own Microsoft Enterprise software, from complexity of installation to difficulty to upgrade, etc. - all problems familiar to Microsoft clients. This complexity adds up to huge expenses for large clients and insurmountable hurdles for small clients. To address, Microsoft is going to offer all its enterprise software as services online. This includes things like Exchange, Sharepoint and Dynamics (their CRM offering). They showed a slide that listed several companies that have already signed up to handle their needs this way, including Energizer and at least some portion of Coca Cola. From what I could gather, the services are now hosted by Azure.

Details were kind of thin, but one aspect they did address was sharing of user information. There's a service deployed at the client's AD called the Microsoft Services Connector that provides the interface with the clients AD and the Online Services.

I can already hear people out there screaming about trusting their services to Microsoft, but look at it a different way. Think about how you manage your Exchange, etc. right now - what's the cost just day to day for patches, etc.? What about the cost to upgrade? As far as "trusting" Microsoft, how much do you trust your operations providers right now?

A Lap Around Cloud Services - Part 1

Holy Crap is this session full! It seemed like the no-brainer followup to the keynote, so this was probably to be expected. This is one of the bigger rooms, but all chairs are full and they are standing 2 deep around the perimeter of the room. For the big ones like this they should explore simultaneously broadcasting in another room - perhaps one with a full bar service.

Now we're starting to answer some more questions about Clouds, Windows Azure, etc. This session actually started with some definitions.

The Cloud - A set of connected servers on which you can install and run services and store and retrieve data. He didn't state this explicitly, but I believe peripheral hardware such as load balancers and firewalls would be part of the cloud as well.

He gave an interesting analogy of writing a desktop application and having to worry about bootstrap loading, file access, scheduling, etc. and how that would be ridiculous to consider today. Yet when we do a cloud application, we worry about availability, fault tolerance, disaster recovery, etc. - why do we accept having to recreate all this infrastructure for a cloud app when we would never accept such responsibilities for a desktop app?

Windows Azure provides services for a cloud app similar to how an OS provides services to a desktop app - that's the background for refering to it as an OS for the cloud.

Once that's clear, then the services provided by Windows Azure can be related to those provided by an OS-

  • Abstract execution environment
  • Shared file system
  • Resource allocation
  • Programming environments

Plus more support for utility computing-

  • 24/7 operation
  • Pay for what you use
  • Simpler, transparent administration

OK, this all sounds wonderful, but what's that mean in terms of actual features? Here's the list he gave, we'll go into some of them in more detail.

  • Automated Service Management - You provide rules, platform does work
  • Powerful service hosting environment - All the hardware (servers, load balancers, etc), Virtualized and direct execution
  • Scalable, available cloud storage - Blobs, tables, queues
  • Rich, familiar developer experience - All the cool tools we've come to expect from Microsoft.

Let's look at some of these in more detail

Automated Service Management

The goal of the service management is to keep a service responsive and healthy in the face of failures and upgrades. This is done by detecting failures, violation of health constraints, replacing failed/missing resources transparently, etc. Pretty standard problems and solutions that most organizations struggle with or pay someone else to struggle with.

You tell Windows Azure about your architecture and what it means for your app to be healthy through defining a model via XML. The model defines service topology, health constraints, configuration settings, etc.

They claim to have maintained a balance between power and ease of use, time will tell. If you just can't define your app through the abstractions there is an escape hatch - you can build your own VM and manage the service yourself. This gives you much greater control over your service, but also burdens you with much greater responsibility.

Scalable Available Cloud Storage

Storage is base on simple, essential storage abstractions (their words, not mine), with an emphasis on massive scale, availability and durability. Abstractions cover-

  • Large items - Blobs, filestreams
  • Service state
  • Service communication

Developer Experience
Microsoft's leverage to get developers pushing apps into Azure is going to be the tool support - this is their classic model to employ developers to push their agenda by bribing them with cool tools. There will be support for all the existing .Net toolsets, plus it will support integration with Eclipse. In the future it will support native code and PHP. Finally, to test your cloud apps, there is a cloud simulator that you can run on your desktop. I should point out that it might be dangerous to fly your flight simulator into your cloud simulator.

The session was all carefully timed with the noon rollout of the tech preview of Windows Azure online at noon, complete with the next slide saying "Tech Preview is available Now!" Unfortunately, the speaker talked a little fast and got to that slide around 11:40 and everyone then had to sit around and wait for 20 minutes until he could show it.

Azure will be commercially available in 2009, and will feature strict SLA'a with financial gaurantees. You can learn more at www.Azure.com.

Building High Performance JScript Applications

This was a lunch session, short and not too deep but featuring a couple of interesting points. I will point out the highlights without spending a lot of time on them.

  • The IE8 Script profiler is very, very cool. It gives you all the info you expect from a profiler, such as call count, duration of calls, call trees, etc. I'm looking forward to FINRA rolling out IE7 so we can start the 2 year countdown until we get IE8.
  • Each time you perform JavaScript that touches the layout the browser redraws, so if you add layout a row at at time your are redrawing over and over. The best bet is to assemble all the HTML as a string, then inject it in one step. He showed a the building of a table shrink from over a second to 150 ms based on that tip.
Microsoft Visual Studio: Bringing out the Best in Multicore Systems

Visual Studio 2010 is going to introduce several features address the concept of parallel programming so developers can take advantage of multicore systems. The speaker pointed out that processor speeds are flattening and we can't depend on technology advances to help us increase our performance in the future. We will need parallel programming to "enable new user experiences." Based on my experience, opening up multi-threaded programming to the masses will certainly change user experiences, but perhaps not in the way they anticipate. The Parallel Computing Platform team sounds like a 1930's tobacco company - "Sure, multiple threads are safe - and they'll make your app look really cool!" So, with my tremendous skepticism fully acknowledged, let's dive in!

The speaker put forward the following steps involved in applying parallel computing to your application-

  1. Know your performance goals
  2. Measure your current performance
  3. Identify opportunities where parallel computing can help - hiding latency, speeding up CPU bound processes, etc.
  4. Code the changes
  5. Tune

I'm going to focus on 2, 3 and 4 as that's where the tools demonstrated are applicable. The new profiling tools in 2010 are very impressive. He showed a couple apps and ran them through the profiler. The profiler helps you identify opportunities by displaying deep info in a couple of areas.

CPU Utilization

A graph of the profile time interval is displayed at completion that shows all the cores in the system, how many you are using, how many are idle and how many the system is using. Different points in your application's execution are displayed on the graph, so you can identify exactly where you are in your app at any point on the graph. This allows you to identify where you are not taking full advantage of the cores in the system.

I need to point out that, once again the session is filled with individuals taking flash pictures of a image projected on a screen. Yeah, these are the mental giants you want writing multithreaded applications.

Thread Analysis

The graph will display when and why threads are blocking in great detail. For instance, you don't just see that a thread was blocked for 80 ms because it was writing to a file, you see which line of code was blocked and the name of the file being written. This was spectacular. All the graphs allowed zooming in and drilling down to greater detail.

Having identified areas of opportunity, he then went began to show tool and language extensions to address them. The new features relieve the developer from managing threads by expressing parallelism through simple abstractions. He started with some aspects of LINQ to make it run in parallel, but not being very conversant in LINQ I didn't see how it actually helped. The next two features he went over were parallel_for and parallel tasks. I will try to replicate code snippets that show each, but do not gaurantee syntactic correctness.

parallel_for is a new construct for a for loop that enables all the iterations through the loop to have their own thread and run simultaneously. The app apparently doesn't continue until all threads complete. So code that iterates through a two-dimensional matrics like this-

for (i = 0; i < maxRows; i++)
{
    for (j = 0; i < maxColumns; j++)
    {
        // Do something
    }
}

would become something like

parallel_for (0; maxRows; delegate(int i) {
    for (j = 0; j < maxColumns; j++)
    {
    // Do something with i and j
    }
})

I'm not sure if the system is smart enough to spin up the optimal number of threads - for instance, if maxRows was 2000 you wouldn't want 2000 threads.

The other construct is parallel task invocations. The framework gives you the ability to spin up a bunch of tasks that can be concurrent and manages the thread specifics for you. Here's an example-

void quicksort(int * a, int n) {
    if (n <= 1)
        return;
    int s = partition(a,n);
    task_group g; // I think this is a typo and " = new task_group()" is missing
    g.run([&]{quicksort(a,s);});
    g.run([&]{quicksort(a+s,n-s);});
    g.wait();
}

So the two recursive quicksort calls each get their own thread and the current quicksort call blocks until they are both complete.

At this point he reminded us that "We didn't do everything for you," and went over some of what is still left to the devs-

  • Identifying synchronization issues
  • Identify races and ordering constraints

Oh, is that all! Hopefully all my readers instantly see that this is what makes multithreaded coding so hard to begin with. Creating threads used to be hard, so it scared people - and that was good!. It scared away developers that had no business attempting it. What Microsoft has provided is a new kind of airplane that makes takeoff so easy anyone can now do it, while landing is just as difficult as ever. Technical Managers - set your FxCop settings to look for this stuff right now, this is going to be trouble.

Letters! We Get Letters!

Usually it takes a couple days for this section of the newsletter to really get going. I am thrilled that it is only Day 2 and we have another great batch of correspondence from our readers. Keep 'em coming!

SR from WA(?) writes - I read the PDC newsletter to my son last night as a bed time story. He was a little disappointed that you left the "wizard" demos.

Now this is the right way to raise a kid!  Don't worry little SR Jr., this is a Microsoft show, there will be plenty of wizards before we're done. - Ed.

PP from MD asks - Biff, can you use your phone camera to videotape any amusing skits/videos ? Don't get arrested however, unless you can videotape that too. That would be even more amusing.

Everything's funny until someone triggers the three strikes rule. - Ed.

As usual, send all mail to editor@biffspdcnewsletter.com.

Tomorrow - more lectures and hopefully some Hand-on experiences.

Biff
Inspector #14, Biff's PDC Newsletter