Yes, replication can be behind. If you SHOW SLAVE STATUS on the slave computer, you can see exactly how far behind the slave is on replication. You should design your systems such that a lag in updates doesn't affect the logic of your system.

There are many uses in which this is a non-issue. For example, I use the master-slave relationship for logging. All logs are written to the master, log queries go to the slave. When someone runs a report against the logs, they might get data that's 1-2 seconds behind maximum, and that doesn't matter.

That said, typically on modern machines, replication is almost always less than a second behind.

----- Original Message ----- From: "Fagyal Csongor" <[EMAIL PROTECTED]>
To: "Mysql (E-mail)" <mysql@lists.mysql.com>
Sent: Sunday, April 24, 2005 3:42 PM
Subject: Replication - is there a "server lag"?



Hi,

I am new to replication so excuse me if my question is stupid.

The manual recommends that a nice scenario to take advantage of replication in MySQL is to send all updating queries to the master server, and reading from the slave. I would like to use this setup (as usual, I have many more selects than inserts/updates) but I am a little concerned what happens if the slave is behind the master in updating its DB.

Say I do like this:
1. update something set `a`=1 where c=d (using the master server)
2. update something set `a`=2 where c=d (using the master server)
and then immediately
3. select `a` from something where c=d (using the slave)

What if #3 fetches the value of `a` from the slave before `a`=2 takes place? Is it possible that I get `a`==1? Or does replication take care of that?

Other than that: does anybody here have a Nagios script that checks if replication is running O.K.? :-)

Thanks,
- Csongor

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to