Bluehost.com Web Hosting $6.95

direct all writes to master

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2007
christopher@dailycrossword.com
 
Posts: n/a
Default direct all writes to master

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

Reply With Quote
  #2 (permalink)  
Old 04-25-2007
lark
 
Posts: n/a
Default Re: direct all writes to master

== 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.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0