Network prediction in Outlook Web Access

Originally posted to Shawn Hargreaves Blog on MSDN, Tuesday, June 22, 2010

I am fascinated by how software failures can expose what would normally be internal implementation details.

For instance, my building has a conference room booking system with a screen outside each room showing the meeting schedule. Sometimes this crashes, in which case the screen displays a Windows desktop and error message, upside down. Why upside down? Was that written in a spec somewhere? If so, why? Or did the construction workers make a mistake, accidentally installing the screens the wrong way up, and then someone decided it would be cheaper to work around this in software, changing the app to rotate its output 180° rather than fixing the hardware installation?

But I digress.

So there I was after dinner last night, sitting on the couch, checking my email (yeah, I know, Tracy is right I'm a workaholic). Outlook Web Access was having server trouble: it could display and send emails, but not move or delete anything. Here's what I saw:

Seems to me that Outlook Web Access must be using some kind of network prediction algorithm, similar to a multiplayer game. Although this is obviously a client/server rather than peer-to-peer architecture, they don't bother waiting for a server round trip before updating the local display. To keep the interface feeling snappy, they must go ahead and apply predicted edits to the local state at the same time as change requests are sent to the server. Most of the time I would never notice, but if the server edit fails, that turns out to have been a misprediction, so they have to rollback and undo the local change. My deleted email suddenly reappears, just the same as when a dude I headshotted (headshat?) springs back to life because it turns out he wasn't quite where my local machine guessed he was.

Who knew that email and Halo have so much in common?

Blog index   -   Back to my homepage