Presentation is loading. Please wait.

Presentation is loading. Please wait.

Get Your Replication On: Advanced Techniques, Tips and Tricks Chris Schneider Sarah Sproehnle.

Similar presentations


Presentation on theme: "Get Your Replication On: Advanced Techniques, Tips and Tricks Chris Schneider Sarah Sproehnle."— Presentation transcript:

1 Get Your Replication On: Advanced Techniques, Tips and Tricks Chris Schneider Sarah Sproehnle

2 Outline  Typical replication usage  Other uses of replication  SSL  Blackhole  Rationale for different topologies  Replication over WAN  What if your slave can't keep up?  Different storage engines on master and slave

3 Typical Replication  One master, N slave(s)‏  Scaling, backups and failover

4 Other uses  SSL - Encrypt replicated data (e.g., credit cards) - PKI & PCI - Similar to SSL between client & server, but add options to CHANGE MASTER TO  Blackhole

5 Different Topologies  Relay slave (master->slave->slave) - See last slide for blackhole - A single master can handle a few dozen slaves. Beyond that use a relay. - Binlog filtering  Master-master - Active/passive manner for failover and failback - Active/active for availability (not scaling). This requires caution: auto_increment_increment & auto_increment_offset, log_slave_updates, race conditions, split brain.  Circular - Same issues as master-master - Huge points of failure

6 Replicate over a WAN  Considerations - Bandwidth - Latency issues - Security (SSL)‏  MySQL settings to address - slave_net_timeout - master_connect_retry - slave_compressed_protocol

7 What if slave can’t keep up  The problem: - Single thread execution on slave (SQL thread)  Possible solutions: - More horsepower on slave (Faster IO and more RAM) - Remember the slave is not only doing replication, but also reads (usually) - Change slave schema (different indexes, less constraints) - Split the slave into separate slaves with replicate_do_db

8 Different storage engines  It sounds great: - Master needs InnoDB's row-level locking, foreign-key constraints, transactions - Slave is primarily reading and could benefit from MyISAM's small footprint, fast reads, fulltext indexes  Doesn't always work - Slave is also doing replication and the table-level locks can be problematic  Be careful: - foreign-key cascading behavior - lack of crash-recovery for MyISAM

9 Q&A  Questions?


Download ppt "Get Your Replication On: Advanced Techniques, Tips and Tricks Chris Schneider Sarah Sproehnle."

Similar presentations


Ads by Google