This is a discussion on direct all writes to master within the MySQL Database forums, part of the Database Forums category; Greetings! I will be setting up a single dedicated database server next week, but I expect it may need to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings!
I will be setting up a single dedicated database server next week, but I expect it may need to be clustered sometime in the next 1-2 years, so I am pre-reading up on MySQL replication. I keep running into the phrase "You should set up one server as the master and direct all writes to it." and I am wondering what technique is considered correct or best. I currently use (Java) DriverManager.getConnection("jdbc:mysql:// localhost/whateverdatabase","whateveruser","whateverpassword "); but the connections will no longer be 'localhost' (obviously hehe). Should I set up 2 subdomains, one for writing and 1 for reading, then tell my load balancer to only balance the one for reading and pass the one for writing straight to the master server? This seems straightforward. How does this affect connection pooling (which I also haven't set up)? Is there a different setup for connection pooling on a cluster, or does it all happen behind the scenes? Cheers! -- clh |
|
|||
|
== Quote from christopher (christopher@dailycrossword.com)'s article
> Greetings! > I will be setting up a single dedicated database server next week, but > I expect it may need to be clustered sometime in the next 1-2 years, > so I am pre-reading up on MySQL replication. I keep running into the > phrase "You should set up one server as the master and direct all > writes to it." and I am wondering what technique is considered > correct or best. > I currently use (Java) DriverManager.getConnection("jdbc:mysql:// > localhost/whateverdatabase","whateveruser","whateverpassword "); > but the connections will no longer be 'localhost' (obviously hehe). > Should I set up 2 subdomains, one for writing and 1 for reading, then > tell my load balancer to only balance the one for reading and pass the > one for writing straight to the master server? This seems > straightforward. > How does this affect connection pooling (which I also haven't set > up)? Is there a different setup for connection pooling on a cluster, > or does it all happen behind the scenes? > Cheers! > -- clh i guess i don't completely understand your questions/issue! but a master/slave configuration is what mysql uses to replicate data from a master database to a slave database. the master and slave(s) become essentially replicas of each other and one can easily change an ip address and/or a server name to switch databases in case a master and/or one of the slaves go down. it's relatively easy to setup if you do about an hour of reading on mysql's website. |