Reliable Mysql Using Replication: Issac Goldstand Mirimar Networks
Reliable Mysql Using Replication: Issac Goldstand Mirimar Networks
Reliable Mysql Using Replication: Issac Goldstand Mirimar Networks
Replication
Issac Goldstand
Mirimar Networks
www.mirimar.net
[email protected]
What is replication?
• Allows 2 or more databases to maintain state
between them
• MySQL 3.23 and up supports asynchronous
replication
• One server acts as a master for one or more
slaves
• Slaves pull data to be replicated from server’s
binary logs and execute the relevant statements
locally
Replication basics…
Slave
Master Slave
Slave
Slaves
DATA DATA
INSERT
INTO …
DATA
DATA
Binary INSERT
Log INTO …
DATA
DATA
DATA DATA
DATA
Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT) Client (SELECT)
Replication Strategies
• Load balancing – single write, distributed read
• Load balancing – circular read/write
MySQL
Server
Replication Strategies
• Load balancing – single write, distributed read
• Load balancing – circular read/write
• High availability (hot failover)
DATA DATA
Client Client
INSERT / SELECT INSERT / SELECT
Slave