Your SlideShare is downloading. ×
0
Various MySQLHigh Availability (HA) SolutionsPercona Live MySQL Conference, London, Oct 24th and 25th, 2011           Oli ...
About FromDual GmbH (LLC)●   FromDual provides neutral and independent:    ●  Consulting for MySQL (on-site and remote)   ...
Contents    Various MySQL High Availability (HA) Solu-    tions    ➢        MySQL Replication / MySQL Scale-Out    ➢      ...
MySQL Scale-Out vs Scale-Up         ● Costs                              Scale-Up         ● MySQL Design         ● Physica...
High-Availability with Replication                                 Application                    read only               ...
Replication fail-over                             Application                read only                                 VIP...
Advantages / Disadvantages Simple „standard“ Set-up Master is a SpoF! (Single Point of Failure) If master fails → which Sl...
Master-Master Replikation                  App        App          App                             VIP                    ...
Master-Master Replication                  App        App          App                             VIP                    ...
Advantages / DisadvantagesOnly slightly more complex than Master/SlaveCareful when writing on both Masters!For a “balanced...
Active/passive fail-over with SAN              App       App            App                               VIP             ...
Active/passive fail-over with SAN●   SPOF!        App       App            App                                  VIP       ...
Advantages / Disadvantages    Synchronous replication●   I/O throughput depends on SAN (I/O system)    No data IN-consiste...
Active/passive fail-over withDRBD                  App       App            App                                   VIP     ...
Active/passive fail-over withDRBD              App       App            App                               VIP             ...
Advantages / Disadvantages Synchronous replication No data IN-consistencies possible I/O throughput lower Slaves are autom...
Galera (synchronous) Replication           App         App            App             Load balancing (LB)          Node 1 ...
Galera (synchronous) Replication           App         App            App             Load balancing (LB)          Node 1 ...
Advantages / DisadvantagesSynchronous replicationBased on InnoDB SE (other SE theoretically possible)Active-active real mu...
MySQL Cluster                               App          App            App                                   Load balanci...
Advantages / Disadvantages Synchronous replication No data IN-consistencies possible Extremely high throughput (if done co...
Tungsten Replicator             www.fromdual.com   22
Advantages / Disadvantages●   Similar to MySQL Replication    Introduces Global Transaction-ID    Asynchronous Replication...
Questions ?Discussion ?  www.fromdual.com   24
Upcoming SlideShare
Loading in...5
×

Percona Live: Various MySQL High Availability (HA) Solutions

1,721

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,721
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
67
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "Percona Live: Various MySQL High Availability (HA) Solutions"

  1. 1. Various MySQLHigh Availability (HA) SolutionsPercona Live MySQL Conference, London, Oct 24th and 25th, 2011 Oli Sennhauser Senior MySQL Consultant at FromDual GmbH oli.sennhauser@fromdual.com www.fromdual.com 1
  2. 2. About FromDual GmbH (LLC)● FromDual provides neutral and independent: ● Consulting for MySQL (on-site and remote) ● Remote-DBA Services / MySQL Operations ● Premium Support (ex. MySQL Basic and Silver) ● Training for MySQL● Consulting partner of the Open Database Alliance (ODBA.org)● Oracle Silver Partner (OPN)● More information you can find at: http://www.fromdual.com www.fromdual.com 2
  3. 3. Contents Various MySQL High Availability (HA) Solu- tions ➢ MySQL Replication / MySQL Scale-Out ➢ High-Availability with Replication ➢ Master-Master Replication ➢ Active/passive fail-over with SAN ➢ Active/passive fail-over with DRBD ➢ Galera (synchronous) Replication ➢ MySQL Cluster ➢ Tungsten Replicator www.fromdual.com 3
  4. 4. MySQL Scale-Out vs Scale-Up ● Costs Scale-Up ● MySQL Design ● Physical bottlenecks ● „Relaxation of Constraints“ Scale-Out www.fromdual.com 4
  5. 5. High-Availability with Replication Application read only VIP rtw Slave Reporting Slave M Master async! Slave Backup Slave 1 Slave 2 Slave 3 ... Load balancer● Fail-over? www.fromdual.com 5
  6. 6. Replication fail-over Application read only VIP rtw Slave Reporting Slave M Master async! Slave Backup Slave 1 Slave 2 Slave 3 ... Load balancer www.fromdual.com 6
  7. 7. Advantages / Disadvantages Simple „standard“ Set-up Master is a SpoF! (Single Point of Failure) If master fails → which Slave becomes new master? Switch → a lot of work, delicate! There are tools to help (MMM v1/v2, MHA, Tungsten, ...) Fail-over Site is already warm/hot! Works very well if r >> w Data inconsistencies (mk-table-check/sync) Delay Master/Slave Slave lagging (Slave as bottleneck) www.fromdual.com 7
  8. 8. Master-Master Replikation App App App VIP M1 M2 Slave1 Slave2 Slave3 SlaveBackup Load balancer (LB) www.fromdual.com 8
  9. 9. Master-Master Replication App App App VIP M1 M2 Slave1 Slave2 Slave3 SlaveBackup Load balancer (LB) www.fromdual.com 9
  10. 10. Advantages / DisadvantagesOnly slightly more complex than Master/SlaveCareful when writing on both Masters!For a “balanced” system at least 2 Slaves are neededYou will NOT get more I/O throughput!Data in-consitency possible because of asynchronous replicationFail-over Site is already warm/hot!Works very well if r >> wData inconsistencies (mk-table-check/sync)If Master fails, half of the Slave are out of sync!A little more complicated to (re-)set-upDelay Master/SlaveSlave lagging (Slave as bottleneck) www.fromdual.com 10
  11. 11. Active/passive fail-over with SAN App App App VIP M M SAN Slave1 Slave2 Slave3 Load balancing (LB) www.fromdual.com 11
  12. 12. Active/passive fail-over with SAN● SPOF! App App App VIP M M !!! SAN Slave1 Slave2 Slave3 Load balancing (LB) www.fromdual.com 12
  13. 13. Advantages / Disadvantages Synchronous replication● I/O throughput depends on SAN (I/O system) No data IN-consistencies possible SAN is a SpoF! Expensive if SAN is not available yet. SANs are not easy to handle! Fail-over Site is still cold! Half of the hardware is idling Only one possible Data source Slaves are automatically and properly fail-overed Far more complex to set-up www.fromdual.com 13
  14. 14. Active/passive fail-over withDRBD App App App VIP M M “Poor mans SAN” DRBD Slave1 Slave2 Slave3 Load balancing (LB) www.fromdual.com 14
  15. 15. Active/passive fail-over withDRBD App App App VIP M M DRBD Slave1 Slave2 Slave3 Load balancing (LB) www.fromdual.com 15
  16. 16. Advantages / Disadvantages Synchronous replication No data IN-consistencies possible I/O throughput lower Slaves are automatically and properly fail- overed Fail-over Site is still cold! Half of the hardware is idling Only one possible Data source Far more complex to set-up www.fromdual.com 16
  17. 17. Galera (synchronous) Replication App App App Load balancing (LB) Node 1 Node 2 Node 3 wsrep wsrep wsrep Galera replication www.fromdual.com 17
  18. 18. Galera (synchronous) Replication App App App Load balancing (LB) Node 1 Node 2 Node 3 wsrep wsrep wsrep Galera replication www.fromdual.com 18
  19. 19. Advantages / DisadvantagesSynchronous replicationBased on InnoDB SE (other SE theoretically possible)Active-active real multi-master topologyRead and write to any cluster nodeAutomatic membership controlTrue parallel replication, on row levelNo slave lagNo lost transactionsRead AND write scalability (Read Scale-Out!)Patch off MySQL binaries (Codership provides binaries)Be aware of Hot Spots on rowsHigher probability of dead locksFull sync blocks for writing → 3 nodesInitial sync for very big databases (>>50 Gbyte) with mysqldump www.fromdual.com 19
  20. 20. MySQL Cluster App App App Load balancing (LB) SQL nodes MySQL MySQL MySQL Server Server Server MGM client MGM client NDB Cluster (Data nodes) ndbd ndbd mgmd mgmd ndbd ndbdData nodes / Mgmt nodes www.fromdual.com 20
  21. 21. Advantages / Disadvantages Synchronous replication No data IN-consistencies possible Extremely high throughput (if done correctly) Good for read AND write New beast to tame (MySQL Cluster != MySQL!) More complex to set-up and operate than normal MySQL Not for disaster fail-over (<= 7.1) Bad for complex queries (Joins, <= 7.1) At least 3 machines (better 4) are need. High demand on RAM and Network Only one possible Data source www.fromdual.com 21
  22. 22. Tungsten Replicator www.fromdual.com 22
  23. 23. Advantages / Disadvantages● Similar to MySQL Replication Introduces Global Transaction-ID Asynchronous Replication Bases on MySQL Binary Log For: MySQL, PostgreSQL, Oracle and Drizzle Requires Java and Ruby? Multi Source Replication Failover should be easier to handle www.fromdual.com 23
  24. 24. Questions ?Discussion ? www.fromdual.com 24
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×