{"id":2262,"date":"2012-02-05T06:01:26","date_gmt":"2012-02-05T11:01:26","guid":{"rendered":"http:\/\/www.bytebot.net\/blog\/?p=2262"},"modified":"2012-02-05T06:30:39","modified_gmt":"2012-02-05T11:30:39","slug":"building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia","title":{"rendered":"Building simple &#038; complex replication clusters with Tungsten Replicator by Giuseppe Maxia"},"content":{"rendered":"<p><a href=\"http:\/\/datacharmer.blogspot.com\/\">Giuseppe Maxia<\/a> of <a href=\"http:\/\/continuent.com\/\">Continuent<\/a>.<\/p>\n<p>MySQL replication is single threaded. Multi-master replication is complex with MySQL. Circular replication works but is very fragile. Once you&#8217;ve achieved the feat, how do you avoid conflicts? The lack of global transaction ID today also means you may have slaves that may not be synchronized fully. Finally, some people like to replicate to PostgreSQL, Oracle and MongoDB.<\/p>\n<p>This is where <a href=\"http:\/\/code.google.com\/p\/tungsten-replicator\/\">Tungsten Replicator<\/a> comes into place. Opensource. 100% GPLv2. You can do easy failover (no need to synchronize the slaves manually when a master dies), have multiple masters, multiple sources to a single slave, conflict prevention, parallel replication, and replicate to Oracle\/PostgreSQL database (heterogeneous replication &#8211; Oracle-&gt;MySQL is not opensource, but MySQL-&gt;Oracle is).<\/p>\n<p>Parallel replication: ability to replicate with multiple thread at once. Sharded by database (all big sites already use this naturally). Good choice for slave lag problems. Bad choice for single database projects. In their tests to measure slave catch up time between standard MySQL &amp; Tungsten slave with 1hr of sysbench and some 130GB of data, MySQL replication takes 4.5h to catchup, and Tungsten takes less than 1 hour to catchup. This comparison was not made with MySQL 5.6 (the same parallel replication feature at this moment in 5.6 is quite buggy). No need to install Tungsten on the master (Tungsten needs to be on slave). Replication can revert to native salve with 2 commands, but the failover is an issue &#8212; so install Tungsten on both!<\/p>\n<p>Conflict prevention. When you have multiple masters you are tempted to do many things that you shouldn&#8217;t. Tungsten provides the multi-master topology. Tungsten can help you avoid conflicts. Decide you want to shard your information by database &#8211; Tungsten can enforce such rules. Define the rules, applied to either the master or the slave and you can then state to make replication fail or drop silently or drop with a warning.<\/p>\n<p>You can create clusters very quickly with Tungsten. You can install from a centralized point to many servers. You need Java, Ruby, SSH access and a MySQL user with all privileges (used for replication).<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Building%20simple%20%26%20complex%20replication%20clusters%20with%20Tungsten%20Replicator%20by%20Giuseppe%20Maxia&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2012%2F02%2F05%2Fbuilding-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"45da43e02c\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-2262\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-2262\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-2262\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Giuseppe Maxia of Continuent. MySQL replication is single threaded. Multi-master replication is complex with MySQL. Circular replication works but is very fragile. Once you&#8217;ve achieved the feat, how do you avoid conflicts? The lack of global transaction ID today also means you may have slaves that may not be synchronized fully. Finally, some people like [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Building%20simple%20%26%20complex%20replication%20clusters%20with%20Tungsten%20Replicator%20by%20Giuseppe%20Maxia&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2012%2F02%2F05%2Fbuilding-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"45da43e02c\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-2262\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-2262\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-2262\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/building-simple-complex-replication-clusters-with-tungsten-replicator-by-giuseppe-maxia?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[23],"tags":[1332,604,1046,1342],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-Au","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2292,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/mysql-creatively-in-a-sandbox-by-giuseppe-maxia","url_meta":{"origin":2262,"position":0},"title":"MySQL Creatively in a Sandbox by Giuseppe Maxia","date":"5\/2\/2012","format":false,"excerpt":"Giuseppe Maxia of Continuent and long time creator of MySQL Sandbox. Only works on Unix-like servers. Works with MySQL, Percona & MariaDB servers. MySQL server has the data directory, the port and the socket - you can't share these. To use it: make_sandbox foo.tar.gz. Then just do .\/use. $SANDBOX_HOME is\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2253,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/mysql-ha-reloaded-by-ivan-zoratti","url_meta":{"origin":2262,"position":1},"title":"MySQL HA reloaded by Ivan Zoratti","date":"5\/2\/2012","format":false,"excerpt":"MySQL HA reloaded - old tricks and cool new tools to guarantee high availability to your MySQL Servers by Ivan Zoratti of SkySQL. This talk is a little longer, so check out: HA Reloaded - many ways to provide High Availability. The slides are already online. Questions to ask: which\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1579,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine","url_meta":{"origin":2262,"position":2},"title":"Sharding for the masses: Introducing the SPIDER storage engine (OpenSQLCamp @ FrOSCon)","date":"27\/8\/2009","format":false,"excerpt":"This is the Sharding for the masses: Introducing the SPIDER storage engine by Giuseppe Maxia, given at OpenSQLCamp, at FrOSCon, in August 2009. These are somewhat live notes, and the slides are available too. Sharding for the massesView more documents from Giuseppe Maxia. Why sharding? Scaling, of course. The MySQL\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":562,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/06\/05\/ticketmaster-thrives-on-mysql-replication","url_meta":{"origin":2262,"position":3},"title":"Ticketmaster thrives on MySQL Replication","date":"5\/6\/2007","format":false,"excerpt":"Even though the conference is long over, I still have unpublished notes sitting on my ~\/Desktop, and it only makes sense that I clean it out. These are notes from Ed Presz's session, titled For Ticketmaster, MySQL Replication is the Ticket! They are as always, pretty raw.We were all given\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2295,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/replication-features-of-2011-by-sergey-petrunia","url_meta":{"origin":2262,"position":4},"title":"Replication features of 2011 by Sergey Petrunia","date":"5\/2\/2012","format":false,"excerpt":"Sergey Petrunia of the\u00a0MariaDB project & Monty Program. MySQL 5.5 GA at the end of 2010. MariaDB 5.3 RC towards the end of 2011 (beta in June 2011). MySQL 5.5 is merged to Percona Server 5.5 which included semi-sync replication, slave fsync options, atuomatic relay log recovery, RBR slave type\u2026","rel":"","context":"In &quot;MariaDB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2283,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/mysql-synchronous-replication-in-practice-with-galera-by-oli-sennhauser","url_meta":{"origin":2262,"position":5},"title":"MySQL synchronous replication in practice with Galera by Oli Sennhauser","date":"5\/2\/2012","format":false,"excerpt":"Oli Sennhauser of FromDual. Synchronous multi-master replication with the Galera plugin. Your application connects to the load balancer and it redirects read\/write traffic to the various MySQL Galera nodes. Tested a setup with 17 SQL nodes and you can have even more. Scaling reads and also a little bit for\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/2262"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=2262"}],"version-history":[{"count":4,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/2262\/revisions"}],"predecessor-version":[{"id":2269,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/2262\/revisions\/2269"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=2262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=2262"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=2262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}