Client-centric Consistency

Monotonic Reads + Monotonic Writes + Read Your Writes + Writes Follow Reads

Data-centric vs. Client-centric

  • Data-centric consistency models aim at providing a system-wide consistent view on a data store.

    • An important assumption is that concurrent processes may be simultaneously updating the data store, and that it is necessary to provide consistency in the face of such concurrency.

  • Client-centric consistency models provide guarantees for a single client concerning the consistency of accesses to a data store by that client.

    • No guarantees are given concerning concurrent accesses by different clients.

    • It assumes no simultaneous updates to the data store or they

      can be relatively easily resolved

Notations

  • Let xix_i and xjx_j be the versions of data item xx.

  • Version xix_i is the result of a series of write operations, which is denoted as the write set WS(xi)WS(x_i).

  • WS(xi;xj)WS(x_i;x_j) means xjx_j follows from xix_i (xjx_j is obtained from xix_i plus some write operations).

  • WS(xixj)WS(x_i|x_j) means we do not know if xjx_j follows from xix_i.

Model 1: Monotonic Reads

If a process reads the value of a data item xx, any successive read operation on xx by that process will always return that same value or a more recent value.

  • In other words, monotonic-read consistency guarantees that once a process has seen a value of xx, it will never see an older version of xx.

  • Use case: distributed email database

    • A user reads his email in San Francisco.

    • He later flies to New York and opens his mailbox again.

    • The messages that were in the mailbox in San Francisco

      will also be in the mailbox when it is opened in New York.

  • Important: study the example in Textbook Section 7.3 Figure 7.16.

Model 2: Monotonic Writes

A write operation by a process on a data item xx is completed before any successive write operations on xx by the same process.

  • Monotonic-write consistency guarantees that write operations by the same process are propagated in the correct order to all copies of the data store.

  • If we have two successive operations Wk(xi)W_k(x_i) and Wk(xj)W_k(x_j) by process PkP_k, then, regardless where Wk(xj)W_k(x_j) takes place, we also have WS(xi;xj)WS(x_i;x_j).

  • Use case: software library

    • Each update replaces one or more functions, leading to a next version.

    • Monotonic-write consistency guarantee that if an update is performed on a copy of the library, all preceding updates will be performed first.

    • The resulting library is indeed the most recent version and includes all updates that have led to previous versions of the library.

  • Important: study the example in Textbook Section 7.3 Figure 7.17.

Model 3: Read Your Writes

The effect of a write operation by a process on data item xx will always be seen by a successive read operation on xx by the same process.

  • In other words, a write operation is always completed before a successive read operation by the same process, no matter where that read operation takes place.

  • Use case: Web documents

    • A user updates a Web document using an editor.

    • He then checks the result from a Web browser.

    • Read-your-writes consistency guarantees that the browser’s or the server’s cache is invalidated when the page is updated.

    • So he can see the updated file instead of cached copy of the original file.

  • Important: study the example in Textbook Section 7.3 Figure 7.18.

Model 4: Writes Follow Reads

A write operation by a process on a data item xx following a previous read operation on xx by the same process is guaranteed to take place on the same or a more recent value of xx that was read.

  • In other words, any successive write operation by a process on a data item xx will be performed on a copy of xx that is up to date with the value most recently read by that process.

  • Use case: network newsgroup

    • A user first reads an article AA.

    • Then she reacts by posting a response BB.

    • By requiring writes-follow-reads consistency, B will be written to any copy of the newsgroup only after A has been written as well.

    • Users see a posting of a reaction to an article only after they have seen the original article.

  • Important: study the example in Textbook Section 7.3 Figure 7.19.

Last updated