I need to deploy a MySQL-based application with the following requirements and would love to receive some guidance (any) as to how I could set things up:
Scale of deployment
5 servers with a latency of
200-400msbetween them.Database content/structure
Running
InnoDB.1GBof data split across 50 tables which are categorized as follows:-user tables: about
200MBacross 10 tables which store information on users (e.g.user,user_favorites,user_votes...).
-content tables: about800MBacross 40 tables which store information about everything else (these tables don't have any relationships with the user tables).Content creation/access
-user tables: each server should have
READ-WRITEaccess to these tables. The frequency of writes depends on users' activity on the website (e.g. people creating account, updating it, voting and/or putting items in favorites...).-content tables: each server should have
READ ONLYaccess to these tables which would be updated once a week when the webmaster updates the website's content (and on some occasions maybe on a daily basis to perform urgent content updates).
And here is the setup I've come up with so far:
- each server would have its own local copy of the database for
READ-ONLYaccess. WRITEqueries foruser tableswould be forwarded to 1MASTERserver using MySQL splitting techniques.WRITEqueries forcontent tableswould be performed directly on theMASTERserver.- The
MASTERserver would be replicated to the other servers operating asSLAVES.
And here are my questions:
Q1: Do you see anything fundamentally wrong with my setup / can you recommend something better?
Q2: What tool would you use to split READ and WRITE queries?
Q3: WRITE queries for user tables are going to be delayed because of the latency of writing to the MASTER: is there anything that can be done to mitigate that?
