The Perils of Error Reduction; or, Starbucks for Programmers

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. Starbucks solves the problem with the same "pattern" we use in messaging architectures — they use a Correlation Identifier. In the US, most Starbucks use an explicit correlation identifier by writing your name on the cup and calling it out when the drink is complete. In other countries, you have to correlate by the type of drink.

via The Perils of Error Reduction – Business – The Atlantic.

Are you stuck with a legacy PHP application? You should buy my book because it gives you a step-by-step guide to improving your codebase, all while keeping it running the whole time.

3 thoughts on “The Perils of Error Reduction; or, Starbucks for Programmers

  1. Note that the cost of failure for Starbucks is giving away a “free” drink and/or a gift card to keep the customer happy.

    Sometimes the cost of failure in software is even less. Sometimes it’s a whole lot more…


  2. What makes asynchronicity a challenge, regardless of environment, comes down to the reality that even though we sense things asynchronously, we don’t think asynchronously; consciousness is one very long 9-track tape. When we started building conceptual processing models, like Turing machines, they also were explicitly sequential. There have been various approaches to non-sequential processing — multitasking, multithreading, and so on, using multiple processors or processor cores. But even though we build the technology, we still don’t really think that way, even when we’re writing programs that work that way. Is it any wonder that error reduction is a major challenge?

Leave a Reply

Your email address will not be published. Required fields are marked *