Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Does master-slave replication ensure that writes show up in later reads?

$
0
0

Here's a very basic question about replication.

If you set up your database with master-slave replication where writes go to the master and reads go to the slaves, doesn't that mean that newly-written data won't necessarily show up in a read until some time later?

For example, suppose a user posts a comment on your website (a write: INSERT INTO comment ...) and then refreshes the page (a read: SELECT * FROM comment ...). The read goes to a slave where the INSERT statement hasn't been replicated yet, so the list of comments comes back without the new one in it. That would effectively violate the "Durability" part of ACID, at least temporarily.

Is that how it actually works? Or is there some way to ensure that users will always be able to read what they just wrote?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>