Menu
Back to Discussions

Read replicas: dealing with replication lag in user-facing applications

Ivan Fernandez
Ivan Fernandez
·61 views
we're using read replicas extensively to scale our postgresql database, which has been great for offloading read traffic. the problem we're consistently running into is replication lag, which can be anywhere from 50ms to 200ms during peak times. this creates a confusing user experience: a user creates a new record, then immediately navigates to a list page, and the new record isn't there yet. we've explored sticky sessions at the load balancer level, but that doesn't fully guarantee consistency if a user's session moves or if they access a different replica. has anyone successfully implemented causal consistency tokens or similar patterns to ensure a user always sees their own writes immediately, even with replication lag, without resorting to always reading from the primary?
7 comments

Comments

Sign in to join the conversation.

Loading comments...