47. Web App Part2
Work App1
Apache
Session
Heartbeat
Apache App2
Standby
48. If Many Nodes!
App1
App1
App1
App1
App1
App1
App1
Session Replication? App1
App1
App1
Too bad! App1
App1
App1
App1
App1
App1
App1
App1
How to Handle?! App
49. Web App Part3
Session Stick
Work App1
Session Stick
Apache
App2
Heartbeat
Session Stick
Apache App3
Standby
50. 2 Issues
Reasons1 Fast
Slow
HTTPS HTTP UDP TCP
Http Application Layer Reasons2
O One Account to One Session,
S Transport Layer
Tcp One Session to One Server.
I
Network Physical Layer
57. If MySQL Master break!
DB
Master
How to Handle?! How to replication?!
58. Part2
App
R/W R/W
Work Replication Standby
DB DB
Master Master
Switch
59. 35% Write 65%Read
DB
DB
write
Read
How to Handle?!
60. Part3
App
MySQL-Proxy
W R
Slave
DB
DB Replication
DB
DB
DB
Master
61. Write I/O bottleneck
Master to Master Not Load Balance
Database Overload
JDBC
Client
JDBC
Client
JDBC
Client
JDBC
Client
JDBC DB
Client
JDBC
Client
How to Handle?!
62. Part4
App
MySQL JDBC round robin
DB
DB DB
MySQL Cluster
MySQL Cluster
63. MySQL Cluster No Support long
columns
MySQL Support Tab
Long columns
NDB Engine
How to Handle?!
64. Part5
App
user_id=1001
Data db_cluster=1
Router
SELECT * FROM
users WHERE
User_id=1001
1-2W
Users 3w-N DB
SELECT * FROM Search
Users
users WHERE DB
username=‘tom’
DB DB Index DB
DB DB
DB_Cluster1
MySQL Master To Master DB_Cluster2
MySQL Master To Master