8 Replication

 

This chapter covers

  • Redundancy
  • Replication

Some of the most complex aspects of distributed systems involve redundancy—­especially redundancy in the presence of failure. The four fundamental principles of database transactions (which you should recall from chapter 5) are famously referred to as ACID guarantees. ACID stands for atomicity, consistency, isolation, and durability.

Let’s recall the definition of durability. Durability guarantees that once a transaction is committed, its effects are permanent, preventing the transaction from going back on its word, so to speak.

The requirement that a transaction be unable to go back on its word, or backtrack, is essential for many business processes. When we receive a positive acknowledgment of a promise, we rely on the durability of the promise to move forward. In an e-­­commerce application, for example, we rely on the durability of a payment processor’s promise to collect payment to ship goods or render services. If the payment processor backtracks, we will be unpleasantly surprised when we realize that we shipped the goods but never received the payment.

8.1 Redundancy

8.2 Thinking about replication and consistency

8.3 Replication

8.4 The mechanics of replication

8.4.1 System model

8.4.2 Replication lag

8.4.3 Synchronous vs. asynchronous replication

8.4.4 State-based vs. log-based replication

8.4.5 Single-leader, multileader, and leaderless systems

Summary