Information Technology Reference
In-Depth Information
1.5.1 Consistency
Consistency means that all nodes see the same data at the same time. If there are multiple
replicas and there is an update being processed, all users see the update go live at the same
timeeveniftheyarereadingfromdifferentreplicas.Systemsthatdonotguaranteeconsist-
ency may provide eventual consistency . For example, they may guarantee that any update
will propagate to all replicas in a certain amount of time. Until that deadline is reached,
somequeriesmayreceivethenewdatawhileotherswillreceiveolder,out-of-dateanswers.
Perfect consistency isnotalways important. Imagine asocial network that awards repu-
tationpointstousersforpositiveactions.Yourreputationpointtotalisdisplayedanywhere
yournameisshown.ThereputationdatabaseisreplicatedintheUnitedStates,Europe,and
Asia. A user in Europe is awarded points and that change might take minutes to propagate
to the United States and Asia replicas. This may be sufficient for such a system because
an absolutely accurate reputation score is not essential. If a user in the United States and
one in Asia were talking on the phone as one was awarded points, the other user would see
the update seconds later and that would be okay. If the update took minutes due to network
congestion or hours due to a network outage, the delay would still not be a terrible thing.
Now imagine a banking application built on this system. A person in the United States
andanotherinEuropecouldcoordinate theiractions towithdrawmoneyfromthesameac-
count at the same time. The ATM that each person uses would query its nearest database
replica, which would claim the money is available and may be withdrawn. If the updates
propagated slowly enough, both people would have the cash before the bank realized the
money was already gone. 1
1 . The truth is that the global ATM system does not require database consistency. It can be defeated by leveraging
network delays and outages. It is less expensive for banks to give out a limited amount of money when the ATM
network is down than to have an unhappy customer stranded without cash. Fraudulent transactions are dealt with
after the fact. Daily withdrawal limits prevent major fraud. Assessing overage fees is easier than implementing a
globally consistant database.
1.5.2 Availability
Availability is a guarantee that every request receives a response about whether it was suc-
cessful or failed. In other words, it means that the system is up. For example, using many
replicas to store data such that clients always have access to at least one working replica
guarantees availability.
The CAP Principle states that availability also guarantees that the system is able to re-
port failure. For example, a system may detect that it is overloaded and reply to requests
with an error code that means “try again later.” Being told this immediately is more favor-
able than having to wait minutes or hours before one gives up.
Search WWH ::




Custom Search