December 2023
Intermediate to advanced
464 pages
12h 35m
English
Serve read requests from followers to achieve better throughput and lower latency.
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.
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 ...