SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Best Practice for Designing and
Implementing MySQL Geographic
Distributed, High Availability Solutions
Marco Tusa
Percona
2
• Open source enthusiast
• MySQL tech lead; principal architect
• Working in DB/development
world over 33 years (yes, I am that old)
• Open source developer and community
contributor
About Me
3
Why Are We Talking About Geographic Distribution?
The need to have geographic distribution for…
3
Why Are We Talking About Geographic Distribution?
The need to have geographic distribution for…
Disaster
Recovery
3
Why Are We Talking About Geographic Distribution?
The need to have geographic distribution for…
Disaster
Recovery
Data close to
consumer/user
3
Why Are We Talking About Geographic Distribution?
The need to have geographic distribution for…
Disaster
Recovery
Data close to
consumer/user
Security by
regulations/laws
3
Why Are We Talking About Geographic Distribution?
The need to have geographic distribution for…
Disaster
Recovery
Data close to
consumer/user
Security by
regulations/laws
4
What is Geographic Distribution?
● What is geographic distribution?
○ Near ! High Availability
○ Far ! Disaster Recovery
• Geographic distribution in
High Availability is to cover
service availability in a location
○ 10 Gb Ethernet best case scenario
400 metre distance max
What is HA and What is DR?
• Geographic distribution in
Disaster Recovery is to assure
we can restore service, in a
geographically distributed location
○ Real speed may vary
○ Linear distance ~1000Km
What is HA and What is DR?
7
The Impact of Distance on Geographic Distribution
A Real-Life Example
I worked on many cases where a customer had two data centers (DC).
I will use information from one of the case as example.
The DC were at a distance of approximately 400 km, connected with a “fiber
channel”.
Server 1 and Server 2 were hosted in the same DC, while Server 3 was in the
secondary DC.
Their ping to Server3 was ~3ms. Not bad at all, right?
We decided to perform some serious tests, running multiple sets of tests with
netperf for many days collecting data. We also used the data to perform
additional fine-tuning on the TCP/IP layer AND at the network provider.
A Real-Life Example
Observations
37ms latency is not very high. If that had been the top limit, it would have
worked.
But, it was not.
In the presence of the optimized channel, with fiber and so on, when the tests
were hitting heavy traffic, the congestion was enough to compromise the data
transmitted.
It hit a latency >200ms for Server 3. Note those were spikes, but if you are in
the presence of a tightly coupled database cluster, those events can become
failures in applying the data, and can create a lot of instability.
Facts About Server 3
The connection between the two was with fiber.
Distance Km ~400 (~800), we need to double because of the round trip,
we also receive packages.
Theoretical time at light-speed =2.66ms (2 ways)
Ping = 3.10ms (signal traveling at ~80% of the light speed) as if the
signal had traveled ~930Km (full round trip 800 Km)
TCP/IP best at 48K = 4.27ms (~62% light speed) as if the signal had
traveled ~1,281km
TCP/IP best at 512K =37.25ms (~2.6% light speed) as if the signal had
traveled ~11,175km
Given the above, we have from ~20%-~40% to ~97% loss from the
theoretical transmission rate.
TCP Encapsulation
Max transportable 1500 MTU – IP Header – TCP Header 1500 – ~40 = 1460 bytes
TCP Sliding Window
Some Numbers
• With 8KB we need 6 IP Frames
• With 40KB we need 28 IP Frames
• With 387KB we need 271 IP Frames
• With 1MB we need 718 IP Frames
• With 4MB we need ~2,800 Frames
All this if we use the full TCP capacity
Which Solutions Are Available?
2 Models
Tightly coupled database clusters
• Datacentric approach (single state of
the data, distributed commit)
• Data is consistent in time cross nodes
• Replication requires high performant
link
• Geographic distribution is forbidden
• DR is not supported
Loosely coupled database clusters
• Single node approach (local commit)
• Data state differs by node
• Single node state does not affect the
cluster
• Replication link doesn’t need to be high
performance
• Geographic distribution is allowed
• DR is supported
Replicate Data is the Key - Sync vs Async
1 Data State
3 Different
Data States
Tightly
coupled
Loosely
coupled
17
Which Implementations?: Primary - Secondary
Replication by internal design
Positive things:
• Each node is independent
• Read scale
• Low network impact
Negative things:
• Stale reads
• Low HA
• Consistent only in the Primary
• Each node has its own data state
Loosely coupled
18
Replication by internal design
Positive things:
• Highly available
• Read scale
• Data is in almost in sync all of the time
Negative things:
• Doesn’t scale writes
• More nodes = more internal
overhead
• Network is a very impacting factor
• 1 Writer only (PLEASE!!!!!)
Which Implementations?: PXC
Tightly coupled
19
Which Implementations?: PS – Group Replication
Replication by standard MySQL
Positive things:
• Highly available
• Read scale
• Data is in almost in sync
all the time
• More network tolerant
Negative things:
• Doesn’t scale writes
• 1 Writer only (PLEASE!!!!!)
Tightly coupled
20
Implementations by HA Level and Tight/Loose Relation
20
Implementations by HA Level and Tight/Loose Relation
Architectures: What Should NOT Be Done 1
London West
London East
Frankfurt
Node 1
Node 2
Node 3
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Architectures: What Should NOT Be Done 1
London West
London East
Frankfurt
Node 1
Node 2
Node 3
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Slave
Architectures: What Should NOT Be Done 2
London West
London East
Frankfurt
Node 1
Node 2
Node 3
Secondary
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Slave
Architectures: What Should NOT Be Done 2
London West
London East
Frankfurt
Node 1
Node 2
Node 3
Secondary
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Architectures: What Can Be Done
Slave
London West
London West
(400 mt limit)
Frankfurt
Node 1
Node 2
Node 3
S-Node1
S-Node2
S-Node3
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Architectures: What Can Be Done
Slave
London West
London West
(400 mt limit)
Frankfurt
Node 1
Node 2
Node 3
S-Node1
S-Node2
S-Node3
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Architectures: What You Should Do
Slave
London Frankfurt
Node 1
Node 2
Node 3
S-Node1
S-Node2
S-Node3
Sync High perf link
Sync Internet link
Async Internet link
Sync High perf internet link
Conclusion - a Healthy Solution
Must have a business continuity plan and cover at least:
● HA
● DR (RTO)
● Backup/restore (RPO)
● Load distribution
● Correct monitoring/alerting
Conclusion - a Healthy Solution*
*I am showing PXC/Galera replication by convenience, but it could also be Percona Server with Group
Replication
Conclusion - a Healthy Solution
Must have a business continuity plan and cover at least:
● HA → (PXC OR PS-GR)
● DR → (PXC OR PS-GR) with Asynchronous replication and RMP
(replication manager for PXC/PS-GR)
● Backup/restore → Backup/restore policy
● Load distribution → ProxySQL with Query rules
● Correct monitoring/alerting → Percona Monitoring and
Management (PMM)
Useful References
● https://www.percona.com/blog/2018/11/15/mysql-high-availability-on-premises-a-geographically-distributed-scenario/
● https://dev.mysql.com/doc/mysql-ha-scalability/en/ha-overview.html
● https://www.percona.com/blog/2014/11/17/typical-misconceptions-on-galera-for-mysql/
● http://galeracluster.com/documentation-webpages/limitations.html
● http://tusacentral.net/joomla/index.php/mysql-blogs/170-geographic-replication-and-quorum-calculation-in-mysqlgalera.html
● http://tusacentral.net/joomla/index.php/mysql-blogs/167-geographic-replication-with-mysql-and-galera.html
● http://tusacentral.net/joomla/index.php/mysql-blogs/164-effective-way-to-check-the-network-connection-when-in-need-of-a-
geographic-distribution-replication-.html
● http://tusacentral.net/joomla/index.php/mysql-blogs/183-proxysql-percona-cluster-galera-integration.html
● https://github.com/sysown/proxysql/wiki
● https://www.percona.com/blog/2018/11/15/how-not-to-do-mysql-high-availability-geographic-node-distribution-with-galera-
based-replication-misuse/
● https://github.com/y-trudeau/Mysql-tools/tree/master/PXC
Best practice-high availability-solution-geo-distributed-final
Best practice-high availability-solution-geo-distributed-final

Weitere ähnliche Inhalte

Was ist angesagt?

Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
Sim Janghoon
 
CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016]
IO Visor Project
 

Was ist angesagt? (20)

Scylla Summit 2022: Making Schema Changes Safe with Raft
Scylla Summit 2022: Making Schema Changes Safe with RaftScylla Summit 2022: Making Schema Changes Safe with Raft
Scylla Summit 2022: Making Schema Changes Safe with Raft
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioning
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
InfluxDB IOx Tech Talks: Replication, Durability and Subscriptions in InfluxD...
InfluxDB IOx Tech Talks: Replication, Durability and Subscriptions in InfluxD...InfluxDB IOx Tech Talks: Replication, Durability and Subscriptions in InfluxD...
InfluxDB IOx Tech Talks: Replication, Durability and Subscriptions in InfluxD...
 
Storing time series data with Apache Cassandra
Storing time series data with Apache CassandraStoring time series data with Apache Cassandra
Storing time series data with Apache Cassandra
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing Guide
 
Database-Migration and -Upgrade with Transportable Tablespaces
Database-Migration and -Upgrade with Transportable TablespacesDatabase-Migration and -Upgrade with Transportable Tablespaces
Database-Migration and -Upgrade with Transportable Tablespaces
 
macvlan and ipvlan
macvlan and ipvlanmacvlan and ipvlan
macvlan and ipvlan
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 
Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDB
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFS
 
Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012
 
Revisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS SchedulerRevisiting CephFS MDS and mClock QoS Scheduler
Revisiting CephFS MDS and mClock QoS Scheduler
 
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
Deep Dive on the Amazon Aurora PostgreSQL-compatible Edition - DAT402 - re:In...
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China Mobile
 
Brkdct 3101
Brkdct 3101Brkdct 3101
Brkdct 3101
 
CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016] CETH for XDP [Linux Meetup Santa Clara | July 2016]
CETH for XDP [Linux Meetup Santa Clara | July 2016]
 

Ähnlich wie Best practice-high availability-solution-geo-distributed-final

Network-aware Data Management for High Throughput Flows Akamai, Cambridge, ...
Network-aware Data Management for High Throughput Flows   Akamai, Cambridge, ...Network-aware Data Management for High Throughput Flows   Akamai, Cambridge, ...
Network-aware Data Management for High Throughput Flows Akamai, Cambridge, ...
balmanme
 
Unit i packet switching networks
Unit i  packet switching networksUnit i  packet switching networks
Unit i packet switching networks
sangusajjan
 
Network-aware Data Management for Large Scale Distributed Applications, IBM R...
Network-aware Data Management for Large Scale Distributed Applications, IBM R...Network-aware Data Management for Large Scale Distributed Applications, IBM R...
Network-aware Data Management for Large Scale Distributed Applications, IBM R...
balmanme
 

Ähnlich wie Best practice-high availability-solution-geo-distributed-final (20)

ROUTING PROTOCOLS new.pptx
ROUTING PROTOCOLS new.pptxROUTING PROTOCOLS new.pptx
ROUTING PROTOCOLS new.pptx
 
Network-aware Data Management for High Throughput Flows Akamai, Cambridge, ...
Network-aware Data Management for High Throughput Flows   Akamai, Cambridge, ...Network-aware Data Management for High Throughput Flows   Akamai, Cambridge, ...
Network-aware Data Management for High Throughput Flows Akamai, Cambridge, ...
 
High performance browser networking ch1,2,3
High performance browser networking ch1,2,3High performance browser networking ch1,2,3
High performance browser networking ch1,2,3
 
Module 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptxModule 1 Introduction to Computer Networks.pptx
Module 1 Introduction to Computer Networks.pptx
 
Network
NetworkNetwork
Network
 
Network in brief
Network in briefNetwork in brief
Network in brief
 
Unit i packet switching networks
Unit i  packet switching networksUnit i  packet switching networks
Unit i packet switching networks
 
Network-aware Data Management for Large Scale Distributed Applications, IBM R...
Network-aware Data Management for Large Scale Distributed Applications, IBM R...Network-aware Data Management for Large Scale Distributed Applications, IBM R...
Network-aware Data Management for Large Scale Distributed Applications, IBM R...
 
Lecture set 1
Lecture set 1Lecture set 1
Lecture set 1
 
Networking lecture1
Networking lecture1Networking lecture1
Networking lecture1
 
LAN Design and implementation of Shanto Mariam University of Creative Technology
LAN Design and implementation of Shanto Mariam University of Creative TechnologyLAN Design and implementation of Shanto Mariam University of Creative Technology
LAN Design and implementation of Shanto Mariam University of Creative Technology
 
Cloud interconnection networks basic .pptx
Cloud interconnection networks basic .pptxCloud interconnection networks basic .pptx
Cloud interconnection networks basic .pptx
 
Evolution of network - computer networks
Evolution of network - computer networksEvolution of network - computer networks
Evolution of network - computer networks
 
Computer Networks Lecture Notes
Computer Networks Lecture NotesComputer Networks Lecture Notes
Computer Networks Lecture Notes
 
Simulating the behavior of satellite Internet links to small islands
Simulating the behavior of satellite Internet links to small islandsSimulating the behavior of satellite Internet links to small islands
Simulating the behavior of satellite Internet links to small islands
 
1 introduction
1 introduction1 introduction
1 introduction
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 
Presentation8
Presentation8Presentation8
Presentation8
 
DITEC - Fundamentals in Networking
DITEC - Fundamentals in NetworkingDITEC - Fundamentals in Networking
DITEC - Fundamentals in Networking
 
Dc ch10 : circuit switching and packet switching
Dc ch10 : circuit switching and packet switchingDc ch10 : circuit switching and packet switching
Dc ch10 : circuit switching and packet switching
 

Mehr von Marco Tusa

Empower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instrumentsEmpower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instruments
Marco Tusa
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
Marco Tusa
 

Mehr von Marco Tusa (20)

Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
 
My sql on kubernetes demystified
My sql on kubernetes demystifiedMy sql on kubernetes demystified
My sql on kubernetes demystified
 
Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
 
Robust ha solutions with proxysql
Robust ha solutions with proxysqlRobust ha solutions with proxysql
Robust ha solutions with proxysql
 
Fortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleuFortify aws aurora_proxy_2019_pleu
Fortify aws aurora_proxy_2019_pleu
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
 
Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...
 
Improve aws withproxysql
Improve aws withproxysqlImprove aws withproxysql
Improve aws withproxysql
 
Fortify aws aurora_proxy
Fortify aws aurora_proxyFortify aws aurora_proxy
Fortify aws aurora_proxy
 
Mysql8 advance tuning with resource group
Mysql8 advance tuning with resource groupMysql8 advance tuning with resource group
Mysql8 advance tuning with resource group
 
Proxysql sharding
Proxysql shardingProxysql sharding
Proxysql sharding
 
Geographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deploymentGeographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deployment
 
Sync rep aurora_2016
Sync rep aurora_2016Sync rep aurora_2016
Sync rep aurora_2016
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
 
Empower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instrumentsEmpower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instruments
 
Galera explained 3
Galera explained 3Galera explained 3
Galera explained 3
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_final
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
 

Kürzlich hochgeladen

Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
nirzagarg
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
SayantanBiswas37
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
HyderabadDolls
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 

Kürzlich hochgeladen (20)

Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 

Best practice-high availability-solution-geo-distributed-final

  • 1. Best Practice for Designing and Implementing MySQL Geographic Distributed, High Availability Solutions Marco Tusa Percona
  • 2. 2 • Open source enthusiast • MySQL tech lead; principal architect • Working in DB/development world over 33 years (yes, I am that old) • Open source developer and community contributor About Me
  • 3. 3 Why Are We Talking About Geographic Distribution? The need to have geographic distribution for…
  • 4. 3 Why Are We Talking About Geographic Distribution? The need to have geographic distribution for… Disaster Recovery
  • 5. 3 Why Are We Talking About Geographic Distribution? The need to have geographic distribution for… Disaster Recovery Data close to consumer/user
  • 6. 3 Why Are We Talking About Geographic Distribution? The need to have geographic distribution for… Disaster Recovery Data close to consumer/user Security by regulations/laws
  • 7. 3 Why Are We Talking About Geographic Distribution? The need to have geographic distribution for… Disaster Recovery Data close to consumer/user Security by regulations/laws
  • 8. 4 What is Geographic Distribution? ● What is geographic distribution? ○ Near ! High Availability ○ Far ! Disaster Recovery
  • 9. • Geographic distribution in High Availability is to cover service availability in a location ○ 10 Gb Ethernet best case scenario 400 metre distance max What is HA and What is DR?
  • 10. • Geographic distribution in Disaster Recovery is to assure we can restore service, in a geographically distributed location ○ Real speed may vary ○ Linear distance ~1000Km What is HA and What is DR?
  • 11. 7 The Impact of Distance on Geographic Distribution
  • 12. A Real-Life Example I worked on many cases where a customer had two data centers (DC). I will use information from one of the case as example. The DC were at a distance of approximately 400 km, connected with a “fiber channel”. Server 1 and Server 2 were hosted in the same DC, while Server 3 was in the secondary DC. Their ping to Server3 was ~3ms. Not bad at all, right? We decided to perform some serious tests, running multiple sets of tests with netperf for many days collecting data. We also used the data to perform additional fine-tuning on the TCP/IP layer AND at the network provider.
  • 14. Observations 37ms latency is not very high. If that had been the top limit, it would have worked. But, it was not. In the presence of the optimized channel, with fiber and so on, when the tests were hitting heavy traffic, the congestion was enough to compromise the data transmitted. It hit a latency >200ms for Server 3. Note those were spikes, but if you are in the presence of a tightly coupled database cluster, those events can become failures in applying the data, and can create a lot of instability.
  • 15. Facts About Server 3 The connection between the two was with fiber. Distance Km ~400 (~800), we need to double because of the round trip, we also receive packages. Theoretical time at light-speed =2.66ms (2 ways) Ping = 3.10ms (signal traveling at ~80% of the light speed) as if the signal had traveled ~930Km (full round trip 800 Km) TCP/IP best at 48K = 4.27ms (~62% light speed) as if the signal had traveled ~1,281km TCP/IP best at 512K =37.25ms (~2.6% light speed) as if the signal had traveled ~11,175km Given the above, we have from ~20%-~40% to ~97% loss from the theoretical transmission rate.
  • 16. TCP Encapsulation Max transportable 1500 MTU – IP Header – TCP Header 1500 – ~40 = 1460 bytes
  • 18. Some Numbers • With 8KB we need 6 IP Frames • With 40KB we need 28 IP Frames • With 387KB we need 271 IP Frames • With 1MB we need 718 IP Frames • With 4MB we need ~2,800 Frames All this if we use the full TCP capacity
  • 19. Which Solutions Are Available? 2 Models Tightly coupled database clusters • Datacentric approach (single state of the data, distributed commit) • Data is consistent in time cross nodes • Replication requires high performant link • Geographic distribution is forbidden • DR is not supported Loosely coupled database clusters • Single node approach (local commit) • Data state differs by node • Single node state does not affect the cluster • Replication link doesn’t need to be high performance • Geographic distribution is allowed • DR is supported
  • 20. Replicate Data is the Key - Sync vs Async 1 Data State 3 Different Data States Tightly coupled Loosely coupled
  • 21. 17 Which Implementations?: Primary - Secondary Replication by internal design Positive things: • Each node is independent • Read scale • Low network impact Negative things: • Stale reads • Low HA • Consistent only in the Primary • Each node has its own data state Loosely coupled
  • 22. 18 Replication by internal design Positive things: • Highly available • Read scale • Data is in almost in sync all of the time Negative things: • Doesn’t scale writes • More nodes = more internal overhead • Network is a very impacting factor • 1 Writer only (PLEASE!!!!!) Which Implementations?: PXC Tightly coupled
  • 23. 19 Which Implementations?: PS – Group Replication Replication by standard MySQL Positive things: • Highly available • Read scale • Data is in almost in sync all the time • More network tolerant Negative things: • Doesn’t scale writes • 1 Writer only (PLEASE!!!!!) Tightly coupled
  • 24. 20 Implementations by HA Level and Tight/Loose Relation
  • 25. 20 Implementations by HA Level and Tight/Loose Relation
  • 26. Architectures: What Should NOT Be Done 1 London West London East Frankfurt Node 1 Node 2 Node 3 Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 27. Architectures: What Should NOT Be Done 1 London West London East Frankfurt Node 1 Node 2 Node 3 Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 28. Slave Architectures: What Should NOT Be Done 2 London West London East Frankfurt Node 1 Node 2 Node 3 Secondary Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 29. Slave Architectures: What Should NOT Be Done 2 London West London East Frankfurt Node 1 Node 2 Node 3 Secondary Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 30. Architectures: What Can Be Done Slave London West London West (400 mt limit) Frankfurt Node 1 Node 2 Node 3 S-Node1 S-Node2 S-Node3 Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 31. Architectures: What Can Be Done Slave London West London West (400 mt limit) Frankfurt Node 1 Node 2 Node 3 S-Node1 S-Node2 S-Node3 Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 32. Architectures: What You Should Do Slave London Frankfurt Node 1 Node 2 Node 3 S-Node1 S-Node2 S-Node3 Sync High perf link Sync Internet link Async Internet link Sync High perf internet link
  • 33. Conclusion - a Healthy Solution Must have a business continuity plan and cover at least: ● HA ● DR (RTO) ● Backup/restore (RPO) ● Load distribution ● Correct monitoring/alerting
  • 34. Conclusion - a Healthy Solution* *I am showing PXC/Galera replication by convenience, but it could also be Percona Server with Group Replication
  • 35. Conclusion - a Healthy Solution Must have a business continuity plan and cover at least: ● HA → (PXC OR PS-GR) ● DR → (PXC OR PS-GR) with Asynchronous replication and RMP (replication manager for PXC/PS-GR) ● Backup/restore → Backup/restore policy ● Load distribution → ProxySQL with Query rules ● Correct monitoring/alerting → Percona Monitoring and Management (PMM)
  • 36. Useful References ● https://www.percona.com/blog/2018/11/15/mysql-high-availability-on-premises-a-geographically-distributed-scenario/ ● https://dev.mysql.com/doc/mysql-ha-scalability/en/ha-overview.html ● https://www.percona.com/blog/2014/11/17/typical-misconceptions-on-galera-for-mysql/ ● http://galeracluster.com/documentation-webpages/limitations.html ● http://tusacentral.net/joomla/index.php/mysql-blogs/170-geographic-replication-and-quorum-calculation-in-mysqlgalera.html ● http://tusacentral.net/joomla/index.php/mysql-blogs/167-geographic-replication-with-mysql-and-galera.html ● http://tusacentral.net/joomla/index.php/mysql-blogs/164-effective-way-to-check-the-network-connection-when-in-need-of-a- geographic-distribution-replication-.html ● http://tusacentral.net/joomla/index.php/mysql-blogs/183-proxysql-percona-cluster-galera-integration.html ● https://github.com/sysown/proxysql/wiki ● https://www.percona.com/blog/2018/11/15/how-not-to-do-mysql-high-availability-geographic-node-distribution-with-galera- based-replication-misuse/ ● https://github.com/y-trudeau/Mysql-tools/tree/master/PXC