Distributed MySQL Architectures, Past, Present and Future1. © 2019 Percona.
1
Peter Zaitsev
MySQL Distributed Architectures
Past Present and the Future
CEO, Percona
Distributed SQL Summit
September 20, 2019
6. © 2019 Percona.
6
Single MySQL Instance Can Do
Hundreds of Thousands of Queries/Sec
Tens of Thousands of Updates/Sec
Traverse Tens of Millions of Rows/Sec
Comfortably Handle Several TB Database size
7. © 2019 Percona.
7
Lets Do Some Math
100.000 QPS
10 Queries per User Interaction
10.000 User Interactions/sec
864.000.000 User Interactions/Day
30 User Interactions/User Avg
28.000.000 Daily Active Users Possible
15M of Daily Active Users counting time of day skew
8. © 2019 Percona.
8
Distributed Systems Tend To be
More Complicated to Develop Against
More Complicated to Operate
Have Additional Performance Bottlenecks
Have Complicated Failure Modes
11. © 2019 Percona.
11
Speed of Light Realities
•Synchronous – Slow
•Asynchronous –
Data Loss Can Occur
Data
Propagation
Can Be
13. © 2019 Percona.
13
Data Distribution
•User Latency Reasons
•Legal and Compliance
Reasons
Some Data
Must be in
Specific
Geographic
Location
15. © 2019 Percona.
15
MySQL Classical Replication
Scaling Reads not so good with Writes
Multi-Tiered replications. Sometimes as many as 150
Replicas
Many,Many Copies of Data
21. © 2019 Percona.
21
Other Problems Operating at Scale
Asynchronous Replication
Replication which is not Crash Safe
Non-Atomic DDL
Single Threaded Replication
Statement Based Replication
Automatic Failover
22. © 2019 Percona.
22
Sharding Complications
Query Routing is the first problem people think about
Multi-Shard Queries
Shard Re-Balancing (online)
23. © 2019 Percona.
23
MySQL is not good for Everything
• Elastic, Solr, SphinxFull Text Search
• Memcache, RedisCaching
• MongoDB, Cassandra, Couchbase etcNon-Relational Storage
• Hadoop, Spark, ClickHouse, RedShiftAnalytics
24. © 2019 Percona.
24
MySQL NDB Cluster
Mostly In-Memory Technology with Automatic Sharding
On Paper solves a lot of Problems
Very Limited Traction in Practice
27. © 2019 Percona.
27
How Sharding is Implemented
Many Organizations
Invested in their Own
Sharding Implementation
Technologies
28. © 2019 Percona.
28
Sharding Solutions
Vitess is leader in MySQL Sharding Space
Simple Sharding can be done with ProxySQL
You can find many project of unknown quality on GitHub
29. © 2019 Percona.
29
MySQL Replication
Can be configured to be Crash-Safe on Master and Slave
Semi-Synchronous Operation mode to limit data loss
Parallel Replication
Multi-Source Replication
Atomic DDL
Row Based Replication
Orchestrator
30. © 2019 Percona.
30
MySQL “Clustering”
Galera (and Percona XtraDB Cluster)
MySQL Group Replication/MySQL
InnoDB Cluster
33. © 2019 Percona.
33
Desire for Scale
While Relatively Few Teams will really
need to operate their system at Scale
Most Teams Not Want Solution which will
not block them if/when they need to scale
35. © 2019 Percona.
35
New Technologies
Vitess has bright future
Oracle will need to have solution for MySQL
So Major Cloud Vendors