
What is Eventual Consistency? - ingve
http://concurrencyfreaks.blogspot.com/2017/07/what-is-eventual-consistency.html
======
Terr_
Perhaps due to the title (which is evocative in Seattle) I often think of
"Starbucks Does Not Use Two-Phase Commit" [0]

[0]
[http://www.enterpriseintegrationpatterns.com/ramblings/18_st...](http://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.html)

P.S.: I feel like I may have thrown this one out without enough context, so
I'm just gonna bloviate a bit in this edit.

The "object" referred to in the OP link -- or what I like to vaguely call the
"unit of consistency" \-- is a single Starbucks employee. They hopefully have
an internally-consistent history of what they believe to be true about the
universe. (And stay sane during coffee-rush times.)

The phrase "eventual consistency" describes the relationship between multiple
employees. Individuals can drastically disagree with one-another, but there's
a framework for detecting disagreements and resolving the discrepancy in some
way, even if that just means agreeing to ignore it and logging it for
management to fix.

A lot of eventually-consistent systems involve _allowing_ certain kinds of
discrepancies to occur, while simultaneously promoting those errors into real
business concepts in the domain. Banking and accounting systems are
particularly great demonstrations of this, because they started doing it
_centuries_ ago when nodes were in cities connected by ink-and-parchments
packets on horse-ridden routes.

------
quizotic
Jim Starkey (founder of NuoDB) is rumoured to have said that any adjective
before the word "consistency" is equivalent to the prefix "in" as in "eventual
consistency is inconsistency". A bit harsh, and not completely true, but a
good warning to a world that increasingly believes eventual consistency is the
best way to handle the CAP theorem.

~~~
ralusek
I would assume that most people are making an informed decision that eventual
consistency is the most palatable compromise for their domain. I don't think
people just look at the CAP theorem and think that eventual consistency is a
magic bullet that gets around one of the necessary compromises, it literally
is one of the proposed compromises.

~~~
saltedmd5
A lot of the time it's not even really a compromise. This is why it makes no
sense to debate about eventual consistency - the implications are entirely
situational.

This kind of buzzword is harmful; it leads to overthinking, over-engineering,
misunderstanding and a lack of focus on what matters, which is implementing
solutions that are appropriate for the current context.

It's also a fallacy (or an artefact of enterprise thinking) that you need to
either adopt eventual consistency or not. Modern systems are increasingly webs
of loosely connected components and subsystems where some processes may be
immediately consistent and others not. This is something that we take for
granted most of the time (e.g. a search index is almost always "eventually
consistent" and nobody would ever think to question that) until we start
talking about the concept in an abstract/contrived fashion.

------
snarfy
It's how banks work.

You write a check and buy something. The banks reconcile and determine you
don't have enough money, and your account goes negative.

If it were atomic, your account could never go negative.

~~~
flukus
It's how banks the 20th century worked with external systems (people in this
case), I bet they were transactional internally once they were computerized.

In the 21st century, if I buy something at a shop and there are not sufficient
funds in my account the transaction is canceled and I walk out of the shop
empty handed. The non-transactional system is still there as a fail over.

~~~
snarfy
This is not true either. All modern POS systems have an offline mode. Have you
ever tried to use your card and the employee says 'the machine is really slow
today'? That's because the machine was offline, but your purchase still
worked. In offline mode the POS will still authorize the purchase up to a
certain amount, typically $75 (up to the store). Those charges are pushed
through after the machine goes online. Yes, it's a failover, but the point is
even the modern online system is still not atomic and has eventual
consistency.

Legitimate purchases outnumber illegitimate purchases by a large factor. It
makes sense to err on the side of legitimate purchases. If it were atomic you
wouldn't have been able to make that offline purchase, even though you had the
money. Since it's true in the majority of cases they let those go through, up
to a certain risk factor (the $75 limit).

------
kellros
I'll tell you later :)

