Using MySQL Distributed Database Architectures
Using MySQL Distributed Database Architectures
Architectures
Peter Zaitsev
CEO, Percona
Percona Technical Webinars
July 31, 2018
© 2018 Percona.
1
Presentation
Cover Basics
How to do it
© 2018 Percona.
2
Distributed ?
© 2018 Percona.
3
Modern MySQL Scalability
© 2018 Percona.
4
Even more Modern MySQL Scalability
© 2018 Percona.
5
Single MySQL Instance Can Do
Hundreds of Thousands of Queries/Sec
© 2018 Percona.
9
Reasons to “Go Distributed”
High Data
Scalability
Availability Distribution
© 2018 Percona.
10
High Availability with MySQL
© 2018 Percona.
11
Q1:What Failure Modes Do you Consider ?
Server Crash/Server Hardware Failure
Network Failure
“Datacenter” Failure
No Data Loss
“Seconds?”
“Minutes?”
“Hours?”
© 2018 Percona.
14
Speed of Light Realities
© 2018 Percona.
16
Data Distribution
Some Data
Must be in •User Latency Reasons
Specific •Legal and Compliance
Geographic Reasons
Location
© 2018 Percona.
17
Distributed Architectures with MySQL
© 2018 Percona.
18
Main Concepts
Replication
Sharding
Failover Management
Traffic Management
© 2018 Percona.
19
Replication
© 2018 Percona.
20
Availability
© 2018 Percona.
21
Availability via Redundancy
Storage Level
Database Level
Application Level
© 2018 Percona.
24
Storage Level Replication
Most Flexible
Most Common
Hot/Warm Spare
Partial Replication/Syncronization
By User
By Customer Account/Company
© 2018 Percona.
29
Sharding and Replication
Read-Write Splitting
Load Management
© 2018 Percona.
33
Replication Options in MySQL
Classical MySQL Replication
© 2018 Percona.
35
Classical MySQL Replication Properties
Asynchronous or Semi-Synchronous
No Built-in Failover
© 2018 Percona.
36
Advanced MySQL Replication Topologies
© 2018 Percona.
37
PMM Dashboard for Replication
© 2018 Percona.
38
MySQL Group Replication
© 2018 Percona.
39
MySQL Group Replication (New in 5.7)
“Group of Peers”
Built in Failover
No Automated Provisioning
© 2018 Percona.
40
Percona XtraDB Cluster/Galera
© 2018 Percona.
41
Percona XtraDB Cluster Topology
© 2018 Percona.
42
PXC/Galera Properties
Write to Any Node
Built in Fail-Over
© 2018 Percona.
44
PXC 5.7 Performance Improvements
http://bit.ly/2qGCr0T and http://bit.ly/2pzvAIW
© 2018 Percona.
45
PMM Dashboard for PXC
© 2018 Percona.
46
MySQL Cluster
Synchronous Replication
Pessimistic Locking
© 2018 Percona.
48
Thinking about Sharding
Shard Balancing
© 2018 Percona.
49
Vitess
Stated by team in YouTube
Deployed at Slack
Supports Re-Sharding
© 2018 Percona.
50
Vitess Architecture
© 2018 Percona.
51
Failover in MySQL
MHA
MySQL Failover
Orchestrator
© 2018 Percona.
52
Orchestrator Screenshot
© 2018 Percona.
53
Traffic Management Solutions
DNS • Not Immediate, Does not handle existing connections
ProxySQL • MySQL Protocol Aware 100% Open Source Proxy Solution for MySQL
© 2018 Percona.
54
ProxySQL
• 100% OpenSource
• Well Supported
• Read-Write Splitting
• Caching
• Query Rewrites
• Load Balancing
• 10k+ Connection Support
© 2018 Percona.
55
Dedicated shared ProxySQL 5
6
ProxySQL
© 2018 Percona.
58
Cloud Only Options
DBaaS in
•Amazon RDS
the cloud
•Amazon Aurora
comes with
•Google Cloud SQL
built-in HA •Azure Database for MySQL
Options
© 2018 Percona.
59
Beyond MySQL
© 2018 Percona.
60
MySQL is a Part of your Data Infrastructure
© 2018 Percona.
62
Cross Technology Replication
Trigger Based • SymmetricDS, Self-Made Solution
Replication Tools
© 2018 Percona.
63
Summary
© 2018 Percona.
65
www.percona.com/live/e18/
Thank You!
© 2018 Percona.
66