One follower in a three-follower cluster is slow. What does it do under asynchronous, semi-synchronous and fully synchronous replication, and what would you change?
Sketch your own answer first, then compare it with the one below.
A strong answer
Under asynchronous replication the slow follower falls behind but writes are not affected. Reads sent to it return stale data, and if it falls far behind it may never catch up. Pull it out of the read rotation when its lag crosses a threshold.
Under fully synchronous replication every write waits for it, so write latency is set by the slowest follower and an outage of that follower stops all writes. That is why fully synchronous setups are rare.
Under semi-synchronous replication a write waits for any one acknowledgement, so a slow follower is skipped as long as another is fast. The risk is that if the fast follower goes away the system either blocks or falls back to asynchronous, which is a silent loss of the guarantee.
In-order application matters here: one delayed message holds up the follower's whole log. Report lag both as time and as entries behind. Remedies are removing the follower from the acknowledging set, throttling writes, or rebuilding it from a snapshot.
Sources
- Martin Kleppmann (2017). Designing Data-Intensive Applications.