not provide absolute guarantees against
safety violations. What if an application
requires that safety is always respected?
There is a growing body of knowledge
about how to program and reason about
eventually consistent stores.
Compensation, costs, and benefits.
Programming around consistency
anomalies is similar to speculation:
you do not know what the latest value
of a given data item is, but you can proceed as if the value presented is the latest. When you have guessed wrong, you
have to compensate for any incorrect
actions taken in the interim. In effect,
compensation is a way to achieve safety
retroactively—to restore guarantees to
users. 13 Compensation ensures mistakes are eventually corrected but does
not guarantee mistakes are not made.
As an example of speculation and
compensation, consider running an
ATM machine. 8, 13 Without strong con-
tency just as well as other errors such
as data-entry mistakes.
maximize B-RC
This decision is, by necessity, application and deployment specific. The
cost of anomalies is determined by the
cost of compensation: too many overdrafts might cause customers to leave
a bank, while propagation of status updates that is too slow might cause users to leave a social network. The rate of
anomalies—as seen before—depends
on the system architecture, configura-
sistency, two users might simultane-
ously withdraw money from an account
and end up with more money than the
account ever held. Would a bank ever
want this behavior? In practice, yes.
An ATM’s ability to dispense money
(availability) outweighs the cost of tem-
porary inconsistency in the event that
an ATM is partitioned from the master
bank branch’s servers. In the event of
overdrawing an account, banks have a
well-defined system of external com-
pensating actions: for example, over-
draft fees charged to the user. Bank-
ing software is often used to illustrate
the need for strong consistency, but in
practice the socio-technical system of
the bank can deal with data inconsis-
tion, and deployment. Similarly, the
benefit of weak consistency is itself
possibly a compound term composed
of factors such as the incidence of com-
munication failures and communica-
tion latency.