Writing something then immediately read when using read/write split: how to deal with replication lag We have an issue where we write to the master table, then immediately must read using the reader. We are experiencing issues with replication lag where the data is not available to the reader at the time we execute our read statement (our replication lag is around 18 ms, which seems pretty fast so I don't think it's a problem with having too much lag). 

What patterns are there to deal with this problem? So far our solutions are:


Just use the writer to read 
Put logic in our code to wait for replication to occur


Are there any other ways of dealing with this?
We have an issue where we write to the master table, then immediately must read ...


If the Requirement is that the read is time-critical and must have the very latest data, then read the very latest data - from the master.
This is especially true if you're generating values as part of the update and need to retrieve them, which you should ideally do within the same transaction.  (Actually, that's about the only reason I can think of that you'd need to read back the [same] data that you've just saved).