July 27, 2010, 3:05 pm
The Asynchronous Barista
By Henry Woodbury
Say you’re a software engineer trying to explain asynchronous processing to people with a general interest in software. You might use Starbucks as an example. Over to you, Gregor Hohpe:
Starbucks, like most other businesses is primarily interested in maximizing throughput of orders. More orders equals more revenue. As a result they use asynchronous processing. When you place your order the cashier marks a coffee cup with your order and places it into the queue. The queue is quite literally a queue of coffee cups lined up on top of the espresso machine. This queue decouples cashier and barista and allows the cashier to keep taking orders even if the barista is backed up for a moment. It allows them to deploy multiple baristas in a Competing Consumer scenario if the store gets busy.
This is a quirky article that introduces a number of programming concepts in an accessible and entertaining way. Hohpe throws in the occasional deep dive — as with the “Competing Consumer” link in the quote — but even there the analogy helps you guess where such a link might take you.
Analogy speaks to shared experience. It provides a way — one way — to turn abstract concepts into visual explanation. I can almost see the coffee cups lined up in front of me.




