AJAX: The Starbucks Factor

Via Neil Kandalgaonkar ran into Starbucks Does Not Use Two-Phase Commit which is one of the essay’s referenced in Joel Spolsky’s new book The Best Software Writing I: Selected and Introduced by Joel Spolsky.

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.

By taking advantage of an asynchronous approach Starbucks also has to deal with the same challenges that asynchrony inherently brings. Take for example, correlation. Drink orders are not necessarily completed in the order they were placed. This can happen for two reasons. First, multiple baristas may be processing orders using different equipment. Blended drinks may take longer than a drip coffee. Second, baristas may make multiple drinks in one batch to optimize processing time. As a result, Starbucks has a correlation problem. Drinks are delivered out of sequence and need to be matched up to the correct customer.

Sound familiar?

The trail leads on to Will the Real Asynchrony Please Stand Up? and a book called Enterprise Integration Patterns. Some food for thought…

3 Responses to AJAX: The Starbucks Factor
  1. buy bontril
    June 8, 2006 | 10:40 pm

    buy bontril…

    buy bontril Phrm889NetW0rkJP …

  2. […] ith AJAX this may mean you need to implementing “queueing” or sequencing – the Starbucks factor. Latency is not predictable. Basically the same point as abov […]

  3. inf@ectio.us
    September 15, 2005 | 11:16 pm

    Links to essays in Best Software Writing I

    From: brevity.org — Links to essays in Best Software Writing I
    Joel Spolsky
    has compiled a book of essays on software, which he calls The
    Best Software Writing I.
    The essays all came from online sources, but when Spolsky released the
    chapter listing, I d