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?