Scale your database traffic with Read & Write split using MySQL Router
This webinar recording dives into the world of MySQL Router and its capabilities for effectively managing high database traffic loads.
You'll learn:
• The challenges of scaling database traffic
• How MySQL Router facilitates read/write splitting
• The benefits of implementing read/write splitting
• Step-by-step demonstrations for configuring MySQL Router for:
1. Static read/write routing for standalone servers
2. Dynamic read/write split for InnoDB Cluster & Replica Set
• A comparison of popular load balancers (MySQL Router, ProxySQL, Maxscale)
Mydbops is a trusted database management and consultancy provider, helping businesses achieve optimal database performance and scalability.
Connect with Mydbops!
Website: https://www.mydbops.com/
Email: info@mydbops.com
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
Scale your database traffic with Read & Write split using MySQL Router
1. Scale Your Database Traffic with
Read/Write Splitting using MySQL Router
Presented by
Vignesh Prabhu S
Database Reliability Engineer II
Mydbops
Mydbops MyWebinar - 31
Apr 13th, 2024
3. ● Introduction to MySQL Router
● Why MySQL Router? & It’s Features
● MySQL Router: Destination & Routing Strategy
● Use Cases of MySQL Router
● Case 1: Static RW Routing for Standalone Servers
● Case 2: Dynamic RW Split for InnoDB Cluster
● Case 3: Dynamic RW Split for Innodb Replica Set
● Load Balancer Comparison
Agenda
5. ● Part of InnoDB Cluster
● Transparent routing between application and back-end MySQL Servers
● High Availability Solution
● Easily Scalable
Introduction to MySQL Router
6. ● Auto Failover
● Highly Available
● Zero Config Changes during addition / deletion of nodes
Why MySQL Router?
7. ● Transparent Routing - Default
● High Availability - InnoDB Cluster
● Load Balancing
● Routing Strategy - 8.0.4
● Read/Write Splitting - 8.3
● Automatic Failover
● Bootstrap Configuration - Cluster and Replica Set
● Cross-Version Compatibility
Features
18. Case 1: Static Read and Write Routing
Advantages:-
● Routing can be done based on the Routing_strategy
● Read and Write Split is available for the static destinations
Limitations:-
● Configuration is Manual
● Automatic Failover is not available
● Dynamic Destinations can’t be added. It requires the restart of the
router.
● Separate Ports needs to be used for Read and Write.
22. Directories & Files Created:-
Case 2: Router R/W Split for InnoDB Cluster - Configuration
File / Directory Purpose
start.sh To start the MySQL Router for the Innodb Cluster
stop.sh To stop the MySQL Router for the Innodb Cluster
mysqlrouter.conf MySQL Router Configuration file for Innodb Cluster
data/state.json Contains Innodb Cluster Primary Information
log/ Log Directory that holds the MySQL router log
25. Conditions for RW Split:-
● Connection Sharing must be enabled
● Destinations Should be targeted to metadata-cache
● access mode should be in AUTO
● Protocol should be in CLASSIC
● Server & Client ssl modes should be in PREFERRED
Case 2: Router R/W Split for InnoDB Cluster - Configuration
26. Advantages:-
● Bootstrapping is available.
● Automatic Failover for HA system
● Destinations will be changed with respect to the Cluster Node Availability
● Native Support for R/W Split
Case 2: Router R/W Split for InnoDB Cluster
29. Replica Set Node IPs -
Case 3: Router R/W Split for InnoDB Replica Set
Cluster Nodes IP Hostname
Source 172.31.0.196 ip-172-31-0-196
Replica 172.31.7.51 ip-172-31-7-51
33. Advantages:-
● Bootstrapping is available.
● Destinations will be changed with respect to the Cluster Node Availability
● Native Support for R/W Split
Limitation:-
● Manual Failover is required via MySQL admin api
Case 3: Router R/W Split for InnoDB Replica Set
36. Load Balancer Comparison
Features MySQL Router ProxySQL Maxscale
Easy Setup with bootstrap function YES Yes NO
Auto Addition of Cluster Nodes YES Yes NO
InnoDB Replica Set support YES NO NO
Auto Addition of Replica Set Nodes YES NO NO
Load Balancing based on Connection YES YES YES
Load Balancing Based on weight NO YES YES
Regex Based routing NO YES YES
Query Caching NO YES YES