Agent Wranglers

Caches and copies Recommended

Read from replicas only what may lag

Send reads to a replica only when a few seconds of delay is acceptable. Read your own writes from the primary.

How to do it

After a user changes something, read it back from the primary for that user, or wait until the replica has caught up. Monitor replica lag and stop routing reads to a replica that falls behind.

How to check

Save a change and read it back at once. The user always sees their own change.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/caches-and-copies/replica-lag.