mocha mysql (mocha_mysql@stripped) writes:
> this is a good idea.
> but here is another idea that has been bouncing in my
> head for some time. how about a client/server process
> running on each mysql server to do
> for each mysql client program, you can have a list of
> mysql server to query. on each mysql server you would
> have a replication client and server daemon running.
> this is NOT the same as the mysqld daemon but a
> separate daemon.
> a query would go to the replicating daemon, that
> daemon look through the list of available mysql
> servers (mysqld) and hands off the query to one or all
> of them. each replicating client on each server would
> talk to the replicating daemon to make sure they are
> all in sync.
> i hope that made sense. i think this could be
> prototyped in perl rather quickly. this could also be
> used to load balance each mysql server and query the
> server with the lightest load.
I prototyped something similar to this back in 1995. Yes, it will work, but
you have to be careful that you're not generating excessive network traffic -
it's pretty easy to get the various processes caught in a loop, updating each
other. Also, you might want to consider writing it in C, rather than Perl -
it really needs to be as fast and as lightweight as possible, or you're going
to bog down your child servers.
This is also the idea behind having a "master" web server that takes HTTP GET
requests, then passes the request off to the lightest-loaded server.