Read replicas: dealing with replication lag in user-facing applications
Chen Chowdhury
·23 views
replication lag from read replicas is a constant headache for our user-facing applications. we're seeing anything from 50ms to 200ms of lag, and that's enough to cause really confusing ux. imagine a user creates a new post, the write goes to the primary, and then they immediately navigate to their profile page which reads from a replica. the post isn't there, and they think something went wrong. it's a terrible experience. we've tried sticky sessions, but that just moves the problem around and doesn't guarantee consistency if a user switches devices or their session expires. another option is passing around a 'causal consistency token' or some timestamp to ensure reads are at least as fresh as the last write, but that feels like a huge architectural lift. how do you guys manage this in highly interactive apps where even a small amount of lag is noticeable? are there simpler patterns we're missing?
0 comments