Chapter 16
Follower Reads
Serve read requests from followers to achieve better throughput and lower latency.
Problem
When using the Leader and Followers pattern, it’s possible that the leader may get overloaded if too many requests are sent to it. Furthermore, in a multi-datacenter setup where the client is in a remote datacenter, requests to the leader will be subject to additional latency.
Solution
While the write requests need to go to the leader to maintain consistency, the read-only requests can instead go to the nearest follower. This is particularly useful when clients are mostly read-only.
It is important to remember that clients reading from followers can get old values. There will always be a replication lag between the leader and ...
Get Patterns of Distributed Systems now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.