Ayende @ Rahien

Unnatural acts on source code

Asynchronous order processing

One of the more common challenges that I run into when discussing the notion of async as the main communication mechanism is that there seems to be an entrenched belief that things should be synchronous. It appear to make things simpler, from a conceptual level, while making them significantly more difficult to actually implement them in a production worthy way.

Arguably the most common issue that I hear about is with downloadable materials, and it can be summed up as some variation of:

What do you mean we aren’t going to just start downloading stuff immediately?

That was why I was heartened when I tried to get a few Kindle books (ebooks) and saw that:

image

After about 5 minutes, it changed to this and allowed downloading this:

image

It is sad to say it, but applying to authority may suck as a argument tactic in a moral sense, but it is a damn effective one. Being able to say, here are all the reasons that you want to do that, and this is how Amazon is doing things, make it so much easier to sell this approach.

Comments

Rafal
07/14/2009 11:27 AM by
Rafal

This vampire fascination is something new, isn't it? Hope your recent vacation wasn't anywhere near Transylvania..

Kyle Szklenski
07/14/2009 01:00 PM by
Kyle Szklenski

There's a big difference between pointing out a good reason to do something, showing that it's done on a popular website, and arguing from authority. If Amazon had a crappy website that was badly designed and had no functionality, then your argument would have no weight. However, when you go to an expert in the field of something and use their arguments, it's not an argument from authority, or at least not a bad one - it is perfectly valid, because that person/entity has the knowledge and understanding of the field.

Daniel Auger
07/14/2009 02:26 PM by
Daniel Auger

I use Amazon a lot to sway thinking/get buy in on design decisions. There are very few things Amazon does wrong IMHO. I rarely hear complaints from friends/family about the way the site works.

NotMyself
07/14/2009 02:50 PM by
NotMyself

I hate to say it but I have won several UI arguments recently with "Let's see how google handles this." And then finding an example of what I was talking about in the google environment somewhere.. either mail, docs or reader...

João P. Bragança
07/14/2009 03:12 PM by
João P. Bragança

Asynchronicity is how the world works! The fastest any feedback loop can operate is at the speed of light. Porting everything over to ESB has made my life a lot easier.

josh
07/14/2009 03:25 PM by
josh

checking how something is done in general is standard practice for me, but you also have to know when to follow and when to lead. I think Amazon does a lot of things well, but wouldn't follow their example in every case or circumstance.

Daniel
07/14/2009 03:38 PM by
Daniel

I think where this type of architecture is difficult for people to understand is in typical forms-on-data and search scenarios. For example: Google does not show a "processing your search" page - you simply enter something and the results appear. Similarly, if you enter some bit of data to a form and click 'save', you expect it to appear next time you refresh the list. For example, when you add an item to your cart on Amazon, it appears instantly in your cart. These are the sort of transactions that can be a bugger in a medium load app, but that I still can't get my head around writing asynchronously.

As somebody interested in ESB tech, but struggling to apply it, what I'd really love to see is a reference app like Nerd Dinner or Rob's MVC Storefront re-done with these concepts.

Shane Courtrille
07/14/2009 05:07 PM by
Shane Courtrille

O'Reilly Safari also uses the same trick for downloading PDFs.

firefly
07/14/2009 10:19 PM by
firefly

Nice! I like your post, simple and to the point. I think Amazon is one of the best website out there. 5 minutes is a very reasonable time. Yet I imagine that little window allow the server to process the request in a much efficient manner.

Nigel Holland
08/04/2009 03:31 PM by
Nigel Holland

I can give two good reasons for asynchronous order processing.

  1. Resilience, you can bring down any part of your order processing system but still keep capturing orders.

  2. Smoothing out processing spikes, if captured orders are queued for processing you can smooth out the load on your order processing system.

Comments have been closed on this topic.