SlideShare a Scribd company logo
Submit Search
Upload
MySQL::Replication (Melbourne Perl Mongers 2011-07)
Report
Share
A
Alfie John
Developer at Opera Software
Follow
•
8 likes
•
1,944 views
1
of
255
MySQL::Replication (Melbourne Perl Mongers 2011-07)
•
8 likes
•
1,944 views
Report
Share
Download Now
Download to read offline
Technology
Entertainment & Humor
A
Alfie John
Developer at Opera Software
Follow
Recommended
Talk Nerdy to Me: Optimizing big websites by
Talk Nerdy to Me: Optimizing big websites
Andreas - Creten
1.5K views
•
54 slides
Lighting fast rails with zeus by
Lighting fast rails with zeus
Philipp Fehre
784 views
•
33 slides
Mongrel Handlers by
Mongrel Handlers
Vishnu Gopal
1.1K views
•
29 slides
Async ... Await – concurrency in java script by
Async ... Await – concurrency in java script
Athman Gude
182 views
•
37 slides
End to-End CoffeeScript by
End to-End CoffeeScript
TrevorBurnham
4.9K views
•
26 slides
CoffeeScript Design Patterns by
CoffeeScript Design Patterns
TrevorBurnham
4.8K views
•
64 slides
More Related Content
What's hot
Multithreading and Actors by
Multithreading and Actors
Diego Pacheco
171 views
•
48 slides
2019 PHP Serbia - Boosting your performance with Blackfire by
2019 PHP Serbia - Boosting your performance with Blackfire
Marko Mitranić
36 views
•
71 slides
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop... by
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
Skills Matter Talks
545 views
•
23 slides
Merb by
Merb
Vishnu Gopal
1.5K views
•
14 slides
CoffeeScript presentation by
CoffeeScript presentation
John Lynch
1.6K views
•
19 slides
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com by
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com
Ilya Grigorik
9K views
•
41 slides
What's hot
(20)
Multithreading and Actors by Diego Pacheco
Multithreading and Actors
Diego Pacheco
•
171 views
2019 PHP Serbia - Boosting your performance with Blackfire by Marko Mitranić
2019 PHP Serbia - Boosting your performance with Blackfire
Marko Mitranić
•
36 views
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop... by Skills Matter Talks
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
Skills Matter Talks
•
545 views
Merb by Vishnu Gopal
Merb
Vishnu Gopal
•
1.5K views
CoffeeScript presentation by John Lynch
CoffeeScript presentation
John Lynch
•
1.6K views
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com by Ilya Grigorik
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com
Ilya Grigorik
•
9K views
STP201 Efficiency at Scale - AWS re: Invent 2012 by Amazon Web Services
STP201 Efficiency at Scale - AWS re: Invent 2012
Amazon Web Services
•
1.8K views
Scaling Ruby with Evented I/O - Ruby underground by Omer Gazit
Scaling Ruby with Evented I/O - Ruby underground
Omer Gazit
•
2.9K views
Ruby 1.9 Fibers by Kevin Ball
Ruby 1.9 Fibers
Kevin Ball
•
6.1K views
SmpleGroovyexampleinmule by Muralidhar Gumma
SmpleGroovyexampleinmule
Muralidhar Gumma
•
143 views
AJS — Asynchronous Templating in Node by Evan Owen
AJS — Asynchronous Templating in Node
Evan Owen
•
4.1K views
Top4top Showcase by ay4
Top4top Showcase
ay4
•
388 views
Message Queues & Offline Processing with PHP by marcelesser
Message Queues & Offline Processing with PHP
marcelesser
•
62.2K views
Ruby Proxies for Scale, Performance, and Monitoring by Ilya Grigorik
Ruby Proxies for Scale, Performance, and Monitoring
Ilya Grigorik
•
4.7K views
Phorum MySQL tricks by guestd34230
Phorum MySQL tricks
guestd34230
•
28.5K views
Ruby as a glue language by quakewang
Ruby as a glue language
quakewang
•
2.1K views
Nodejs by Anupom Syam
Nodejs
Anupom Syam
•
724 views
Server-side JavaScript for the rest of us by Kyle Simpson
Server-side JavaScript for the rest of us
Kyle Simpson
•
1.2K views
NullMQ @ PDX by Jeff Lindsay
NullMQ @ PDX
Jeff Lindsay
•
8.2K views
ruby + websocket + haproxy by Mathieu Elie
ruby + websocket + haproxy
Mathieu Elie
•
2K views
Viewers also liked
Replication tutorial presentation by
Replication tutorial presentation
colderboy17
1.7K views
•
125 slides
Percona Live 2012PPT: introduction-to-mysql-replication by
Percona Live 2012PPT: introduction-to-mysql-replication
mysqlops
5.1K views
•
124 slides
MySQL Cluster performance best practices by
MySQL Cluster performance best practices
Mat Keep
25.3K views
•
48 slides
MySQL Group Replication by
MySQL Group Replication
Ulf Wendel
33.1K views
•
92 slides
MySQL Cluster Basics by
MySQL Cluster Basics
Wagner Bianchi
17.2K views
•
77 slides
Percona XtraDB Cluster by
Percona XtraDB Cluster
Kenny Gryp
2.8K views
•
90 slides
Viewers also liked
(6)
Replication tutorial presentation by colderboy17
Replication tutorial presentation
colderboy17
•
1.7K views
Percona Live 2012PPT: introduction-to-mysql-replication by mysqlops
Percona Live 2012PPT: introduction-to-mysql-replication
mysqlops
•
5.1K views
MySQL Cluster performance best practices by Mat Keep
MySQL Cluster performance best practices
Mat Keep
•
25.3K views
MySQL Group Replication by Ulf Wendel
MySQL Group Replication
Ulf Wendel
•
33.1K views
MySQL Cluster Basics by Wagner Bianchi
MySQL Cluster Basics
Wagner Bianchi
•
17.2K views
Percona XtraDB Cluster by Kenny Gryp
Percona XtraDB Cluster
Kenny Gryp
•
2.8K views
Similar to MySQL::Replication (Melbourne Perl Mongers 2011-07)
Kickin' Ass with Cache-Fu (with notes) by
Kickin' Ass with Cache-Fu (with notes)
err
4K views
•
104 slides
Data oriented design and c++ by
Data oriented design and c++
Mike Acton
33.6K views
•
201 slides
Austin Cassandra Meetup re: Atomic Counters by
Austin Cassandra Meetup re: Atomic Counters
Trevor Francis
1.5K views
•
19 slides
Lessons learnt on a 2000-core cluster by
Lessons learnt on a 2000-core cluster
Eugene Kirpichov
1.1K views
•
93 slides
Clustered PHP - DC PHP 2009 by
Clustered PHP - DC PHP 2009
marcelesser
830 views
•
53 slides
Synchronous Reads Asynchronous Writes RubyConf 2009 by
Synchronous Reads Asynchronous Writes RubyConf 2009
pauldix
20.9K views
•
180 slides
Similar to MySQL::Replication (Melbourne Perl Mongers 2011-07)
(20)
Kickin' Ass with Cache-Fu (with notes) by err
Kickin' Ass with Cache-Fu (with notes)
err
•
4K views
Data oriented design and c++ by Mike Acton
Data oriented design and c++
Mike Acton
•
33.6K views
Austin Cassandra Meetup re: Atomic Counters by Trevor Francis
Austin Cassandra Meetup re: Atomic Counters
Trevor Francis
•
1.5K views
Lessons learnt on a 2000-core cluster by Eugene Kirpichov
Lessons learnt on a 2000-core cluster
Eugene Kirpichov
•
1.1K views
Clustered PHP - DC PHP 2009 by marcelesser
Clustered PHP - DC PHP 2009
marcelesser
•
830 views
Synchronous Reads Asynchronous Writes RubyConf 2009 by pauldix
Synchronous Reads Asynchronous Writes RubyConf 2009
pauldix
•
20.9K views
Kafka Summit NYC 2017 - Running Hundreds of Kafka Clusters with 5 People by confluent
Kafka Summit NYC 2017 - Running Hundreds of Kafka Clusters with 5 People
confluent
•
1.6K views
Introduction to XtraDB Cluster by yoku0825
Introduction to XtraDB Cluster
yoku0825
•
3.8K views
Symfony finally swiped right on envvars by Sam Marley-Jarrett
Symfony finally swiped right on envvars
Sam Marley-Jarrett
•
750 views
HTTP Plugin for MySQL! by Ulf Wendel
HTTP Plugin for MySQL!
Ulf Wendel
•
95.3K views
Master master vs master-slave database by Wipro
Master master vs master-slave database
Wipro
•
547 views
Architectural Overview of MapR's Apache Hadoop Distribution by mcsrivas
Architectural Overview of MapR's Apache Hadoop Distribution
mcsrivas
•
7.3K views
Asynchronous programming - .NET Way by Bishnu Rawal
Asynchronous programming - .NET Way
Bishnu Rawal
•
253 views
What is NetDevOps? How? Leslie Carr PuppetConf 2015 by Leslie Carr
What is NetDevOps? How? Leslie Carr PuppetConf 2015
Leslie Carr
•
2.2K views
Triple Blitz Strike by Denis Zhdanov
Triple Blitz Strike
Denis Zhdanov
•
4.8K views
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4 by Ulf Wendel
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
Ulf Wendel
•
8.5K views
Concurrency in ruby by Marco Borromeo
Concurrency in ruby
Marco Borromeo
•
1.9K views
Background processes and tasks in an async world by particlebanana
Background processes and tasks in an async world
particlebanana
•
533 views
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL by Ulf Wendel
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
Ulf Wendel
•
41.9K views
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (... by andreaslubbe
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
andreaslubbe
•
4.9K views
Recently uploaded
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue
120 views
•
62 slides
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue
68 views
•
13 slides
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue
154 views
•
19 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue
128 views
•
20 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.
74 views
•
38 slides
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf
Phactum Softwareentwicklung GmbH
49 views
•
73 slides
Recently uploaded
(20)
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue
•
120 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue
•
68 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue
•
154 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue
•
128 views
Microsoft Power Platform.pptx by Uni Systems S.M.S.A.
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.
•
74 views
20231123_Camunda Meetup Vienna.pdf by Phactum Softwareentwicklung GmbH
20231123_Camunda Meetup Vienna.pdf
Phactum Softwareentwicklung GmbH
•
49 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software
•
373 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue
•
63 views
NTGapps NTG LowCode Platform by Mustafa KuÄŸu
NTGapps NTG LowCode Platform
Mustafa KuÄŸu
•
287 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue
•
75 views
Network Source of Truth and Infrastructure as Code revisited by Network Automation Forum
Network Source of Truth and Infrastructure as Code revisited
Network Automation Forum
•
49 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue
•
134 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue
•
105 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue
•
74 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue
•
81 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue
•
59 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue
•
86 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue
•
52 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue
•
93 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook Presentation
Rob McCarty
•
54 views
MySQL::Replication (Melbourne Perl Mongers 2011-07)
1.
MySQL::Replication
2.
what is it?
3.
It's a replacement
for
4.
MySQL Replication
5.
why?
6.
first...
7.
what is replication?
8.
synchronising data
9.
between multiple databases
10.
db1 db2
11.
why replicate?
12.
examples...
13.
redundancy
14.
database client client
client client client client client client
15.
database on client
client client client client client client client
16.
database on fire
client client client client client client client client
17.
database on fire
client client client client client client client client
18.
database on fire
client client client client client client client client
19.
arhhhh!
20.
If we had
replicated
21.
to a hot
standby
22.
clients could be
moved
23.
Â
24.
Â
25.
another example
26.
performance
27.
database client
28.
database client client
29.
database client client
client
30.
database client client
client client
31.
database client client
client client client
32.
database client client
client client client client
33.
database client client
client client client client client
34.
database client client
client client client client client client
35.
database client client
client client client client client client
36.
database client client
client client client client client client
37.
arhhhh!
38.
If we replicated
39.
for scale out
40.
load would be
spread
41.
Â
42.
Â
43.
Â
44.
Â
45.
Â
46.
Â
47.
Â
48.
Â
49.
so...
50.
why replicate?
51.
because it gives
you benefits
52.
compared to having
53.
a single database
54.
so...
55.
how does it
work?
56.
in particular...
57.
how does MySQL
Replication work?
58.
Â
59.
master
60.
master slave
61.
master client slave
62.
master client binlog
slave
63.
master client binlog
slave relay
64.
master client binlog
slave relay
65.
the cool thing
is
66.
each slave
67.
can be a
master
68.
to other slaves
69.
master slave slave
slave
70.
master slave slave
master/slave slave
71.
master master/slave slave
master/slave slave slave
72.
this works fine
73.
but...
74.
slaves can only
have a single master
75.
master master/slave slave
master/slave slave slave
76.
so?
77.
that means...
78.
no multiple masters
79.
slave master master
master
80.
slave master master
master
81.
why not?
82.
don't ask me
83.
because I don't
know
84.
but...
85.
we can
emulate multiple masters
86.
to do this
87.
we have to
88.
setup a ring
topology
89.
what?
90.
each slave
91.
is a master
92.
to another slave
93.
master slave
94.
master slave master/slave
95.
master master/slave master/slave
slave
96.
master/slave master/slave master/slave
master/slave
97.
Â
98.
so...
99.
how does this
achieve
100.
multiple master replication?
101.
by having each
master
102.
write all
queries
103.
to it's binlog
104.
...including the queries
105.
it replicated
106.
from its
master
107.
huh?
108.
queries are passed
109.
around the ring
110.
kind of like
111.
pass the parcel
112.
Â
113.
why is this
a problem?
114.
when the ring
breaks
115.
Â
116.
Â
117.
Â
118.
Â
119.
Â
120.
arhhhh!
121.
so does everything
else
122.
...and recovery is
hard
123.
why?
124.
infinite loops!
125.
what do you
mean?
126.
each master
127.
is responsible
128.
for termination
129.
of its own
queries
130.
around the ring...
131.
in other words
132.
queries don't replicate
infinitely
133.
because
134.
a master won't
relay
135.
its own queries
twice
136.
Â
137.
so...
138.
what happens if...
139.
a database goes
down?
140.
we recover by
141.
...reconnecting the links
142.
...and restarting replication
143.
?
144.
Â
145.
Â
146.
(OpenOffice doesn't do
the arrow I wanted)
147.
hang on...
148.
who was responsible
149.
for terminating
150.
the failed database's
queries?
151.
hrmmm...
152.
if there are
queries
153.
from the failed
database
154.
still replicating
155.
that haven't yet
terminated
156.
Â
157.
arhhhh
158.
Infinite queries, infinitely
replicating
159.
so...
160.
how can I
achieve
161.
multiple master replication
162.
...that is fault
tolerant
163.
...and is easy
to recover from?
164.
MySQL::Replication
165.
It's a replacement
166.
for MySQL's built-in
replication
167.
it's a client/server
model
168.
each master runs
the server
169.
slave master master
master
170.
slave master master
server
171.
slave server master
server
172.
slave server server
server
173.
each slave runs
the client
174.
...and the client
175.
can run multiple
instances
176.
(one for each
server)
177.
(think peer-to-peer)
178.
slave server server
server
179.
client(s) server server
server
180.
and if something
breaks
181.
client(s) server server
server
182.
client(s) server server
server
183.
client(s) server server
server
184.
only the peer
connection is effected
185.
client(s) server server
server
186.
client(s) server server
server
187.
and if the
failed database recovers
188.
we restart from
where we left off
189.
client(s) server server
server
190.
client(s) server server
server
191.
otherwise
192.
we just fail
it out
193.
and can take
our time rebuilding
194.
it was redundant
anyway
195.
right?
196.
:)
197.
ohh
198.
...and no infinite
loops
199.
why?
200.
since we connect
201.
directly to the
server
202.
no intermediary connections
203.
can break
204.
there's more...
205.
relay caching
206.
say what?
207.
instead of connecting
208.
directly to the
master
209.
the client
210.
connects to a
local relay
211.
if it doesn't
have
212.
the queries we
want
213.
it will get
them for us
214.
example
215.
multiple clients
216.
in data center
A
217.
...each connect
218.
to a server
219.
in data center
B
220.
...each download the
same queries
221.
what a waste
222.
...in bandwidth
223.
...and server load
224.
so...
225.
instead
226.
...each connect
227.
to a local
relay
228.
now...
229.
only a single
client (the relay)
230.
connects to the
server
231.
...saves bandwidth
232.
...saves server load
233.
:)
234.
so...
235.
CPAN?
236.
almost ready
237.
client/server working in
production
238.
I just need
to do the documentation
239.
then I'll put
it on CPAN
240.
what about the
relay stuff?
241.
It's nearly complete...
242.
I just need
to finish
243.
...a couple more
test harnesses
244.
...and write the
documentation
245.
FAQ
246.
what happens with
collisions?
247.
when two databases
248.
update the same
record
249.
It's a race
condition
250.
solution?
251.
solve it at
the application layer
252.
use a broker
for global IDs
253.
or shard writes
254.
questions?
255.
[email_address]