liveBook · Manning

Replication lag

As explained in Grokking Software Architecture

Replication lag is the delay before a data change becomes available in a replica or other asynchronously synchronized copy.

Replication lag is the time between a write on a primary database node and the change appearing across its replicas. During that delay, different readers may see different versions of the data. section 8.2.2

A profile picture catching up

After a profile picture changes, Server A may show the new image while Server B still serves the old one. Once synchronization catches up, both replicas reflect the change. section 8.2.2

An order that appears missing

After a customer places an order, the event consumer may not have updated the database when the orders page loads. Showing a “Processing...” card can reassure the customer instead of displaying an empty list. section 7.3.3

Figure 7.7 Client-Side Intelligence (Optimistic UI) at work. We show the user the success state before the server has actually finished the work.

Shows an optimistic interface displaying the expected result before the server finishes processing. section 7.3.3

How Grokking Software Architecture covers it

How deep it goes
Defines the delay and illustrates its effects, but does not explain synchronization mechanisms or quantify lag.
Examples
Uses a profile-picture update across two servers and a newly placed order missing from the orders page.
What you can do after
Understand why replicas can show stale data and why an optimistic interface can reassure users while updates are pending.
How it connects
Links replication lag to eventual consistency, NoSQL, BASE, read-your-writes, and optimistic UI.

Also explained in

Compare how 6 books explain replication lag →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.