Monday, March 23, 2009

Gregor Hohpe describes asynchronous design using Starbucks

Gregor Hohpe has a wonderful article in IEEE Software Design Magazine called Your Coffee Shop Doesn't Use Two-Phase Commit (PDF).

In the article Gregor describes asynchronous messaging design and error handling by comparing it to how drink orders are handled at Starbucks.
What does Starbucks do if they’ve already placed your drink order into the queue and it turns out you can't pay? They either pull your cup from the queue or toss the drink if it has already been made. Likewise, if they deliver a drink that's incorrect or unsatisfactory, they remake it. If the machine breaks down and they can't make your drink, they refund your money. Each of these scenarios describes a different but common error-handling strategy for loosely coupled systems

So cool. This often happens to me - I am thinking about a "mundane" process such as how families work or why freeways get jammed up and I see how it applies to systems design.

Gregor does a fantastic job of this, helping you understand what may fairly complex concepts very easily by imagining yourself at Starbucks. Definitely a good read.

No comments: