0

I was just working on mysql master-slave setup for incremental data backup from master to slave. For that I have to enable "bin log" in the master machine. So my doubt is how does master and slave communicate. Is it master which pushes new events to all slaves or slaves keep polling to master for new events?

migrated from stackoverflow.com May 16 '16 at 9:02

This question came from our site for professional and enthusiast programmers.

  • Why down voting this? – Shekhar Saha May 16 '16 at 6:23
  • this question does not met guidelines of SO. I suggest improving your questions so people would want to help you. – Smar May 16 '16 at 8:57
0

The Master 'pushes' changes to the TCP/IP port at the same time that it writes them to the binlog. The Slave keeps the TCP/IP port open and receives the changes 'instantly'. It writes them to its "relay log" via the "IO thread". The "SQL thread" 'immediately' sees the change and performs it.

While simple changes happen on the Slave so fast that it is hard to see any delay, there is nothing that guarantees such speed. For example, UPDATEing all rows of a billion-row table would take hours and delay all replication items after that one statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy