

Starbucks Does Not Use Two-Phase Commit (2004) - gejjaxxita
http://eaipatterns.com/ramblings/18_starbucks.html

======
simonebrunozzi
The reason why they call your name is because Schultz, inspired by the "bar"
in Milan in the early 1980's, wanted people to believe they had a barista
friend. Note that "bar" in Italy has roughly the same meaning as "cafe" in the
US. In Italy, then and now, most bars have regular customers, and they get to
know each other's name.

When I moved to Singapore a few years ago, I started drinking my coffee at a
local "Segafredo", and had to teach to the baristas to call me by name
whenever I entered. For a few months, they would say "Buongiorno Mr. Simone"
to me only. I also had to teach them how to do a proper espresso. They were
clueless. (I was a barista in my twenties). One day I hear "Buongiorno Mr.
Giovanni", and I immediately knew it was another Italian. He also did the
same, had to teach them to call him by name, and how to do a proper espresso.
Funny.

~~~
picardo
Nice story, but my Starbucks barista often gets my name wrong. If being
friendly was their intention, rather than matching orders and drinks, they
certainly haven't gotten the memo.

~~~
icambron
I give a different name. My problem isn't so much that no one knows how to say
mine; it's that no one knows how to spell it, and since someone else reads it,
they generally fumble the totally weird series of letters the other barista
wrote down. So I started to think of it as less about providing my name -- I
don't care about fake familiarity -- and more about providing a uniquish
identifier. So I optimize for that: pick a name that everyone knows but few
people have. "Art" works pretty well.

~~~
e12e
Not Ford Prefect? ;-) (I suppose Art Dent is close enough...)

------
abalone
Fun article, but the title is a little misleading. It's not that Starbucks
doesn't use 2-phase commit. It's that they break their sales process into a
couple of atomic transactions that run in parallel: payment and delivery. Each
of those steps still in fact uses 2-phase commit.

Running a credit card or accepting cash is 2-phase commit. Drink pickup could
be seen as a 2-phase commit (put drink on counter, confirm name, take back if
name doesn't match). What's interesting is the exception handling logic
between these parallel transactions. I.e. if payment fails while drink is
getting made, try to cancel the drink delivery.

So the issue here is not "atomic or nonatomic", it's "how do I break a
business process down into a set of atomic transactions". Very few businesses
are going to run their entire supplier-to-customer process inside of a single
atomic transaction.

------
yodasan
One additional concept that Starbucks handles is name collisions. If there are
two Mikes, the person then must check the type of drink in order to
differentiate his order from the other Mike's order. If they happen to be the
same, it goes to the first person who ordered (or if one Mike is not aware of
the other Mike, it's first come, first serve).

~~~
holyjaw
In practice, most people hear "Mike, your Grande Triple-Shot Vanilla Latte is
ready!" and immediately someone picks up the drink, studies it, and asks "Is
the a Caramel Frappuccino for Dan? I don't see the Whipped Cream!"

I don't know what the programming equivalent is.

~~~
nwh
Optimistically fuzzy matching?

------
akent
Probably worth a (2004) tag.

~~~
mhb
And the links to the preceding discussions:

[https://www.hnsearch.com/search#request/all&q=starbucks+two+...](https://www.hnsearch.com/search#request/all&q=starbucks+two+phase+commit&start=0)

------
martingordon
I was in Japan last March and one of the souvenirs I brought back was a
Starbucks cup holder with my name written on it in Japanese. Granted, it was
at a rest stop Starbucks, and I don't recall if they actually called my name
out, but perhaps things have changed since 2004 or they treat tourists
differently.

------
coffeedan
If I have no choice but to get my coffee at a Starbucks, I will always order a
"brewed coffee". The order is filled by the order-taker and therefore not
subject to any of this barrista bullshit..

------
pixelcort
One thing the article doesn't point out is that, in Japan, coffee shops don't
usually take your name during your order.

This means that the customer must listen for the name of their drink instead
of their name. Also, when two people order the exact same drink, it can be
ambiguous who gets the first served drink.

~~~
esolyt
> 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.

~~~
officemonkey
In my Starbucks, they keep the drinks in a FIFO stack. My drink might be done,
but they wait until the other drinks in the queue are delivered before they
call mine.

This is okay most of the time, but it is annoying when the person in front of
me has a large drink order and I can see my drink ready.

~~~
re_todd
That sounds like my Starbucks. I was sitting at a table and overheard a
customer complaining that they got their coffee after someone that ordered
after them. After the customer left, I heard the Starbucks manager explain to
the new hire that the "queue" is very important. It thought "wow, this sounds
like my old Data Structures class!"

------
liquidcool
In the Philippines, they ask for your name, but also ask for the receipt when
you pick up your drink. I assume that's primarily for theft prevention. But it
was wonderful to have everyone get your name right on the first try (it's
Philip).

------
llcoolv
The article is actually on mapping Messaging, Conversation Pattern and
Asynchronous Processing to a real world example. Everybody keeps talking about
coffee :)

