On Mon, 30 Oct 2000 07:12:19 +0100 (MET), Peter Korsgaard said:
> I'm working on a SQL proxy for distributing load as a project at
> university. The idea is to have a system, which can transparently be
> inserted between an existing database and its clients, to allow the system
> performance to scale by adding more databases as the load increases. This
> way we don't need to recode the clients.
> Below is a diagram of the system.
> Client 1 Database 1
> _____ _____
> | | | |
> | |<----- Proxy (distributor) ----->| |
> |___| | SQL _____ SQL | |___|
> ------------->| |<-----------
> . | | .
> . ------------->|___|<----------- .
> | SQL SQL |
> Client n | | Database m
> _____ | | _____
> | | | | | |
> | |<----- ----->| |
> |___| |___|
> The job of the proxy is to look at the querys: If the query is a select it
> can be transmitted to only on of the databases, but if it is an
> update/insert it has to go to all of them. Furthermore it should monitor
> the set of databases, and exclude databases that stop working, and update
> them when thay again become available.
> I have been browsing a bit around mysql.com and looking at the c client
> library, but I haven't been able to find any information about the
> protocol used between the mysql database and the client, Is such
> information available anywhere, or could anyone point me to areas of
> interest in the mysql server code?
> Thanks in advance!
> Bye, Peter Korsgaard
First of all, I do not think you should meddle with updating all
databases. You should make one machine a master and other as slaves,
and you should let our replication system take care of updates.
All you have to do is send all updates to the master while SELECT's,
SHOW's, EXPLAINS's and other commands that do not change data should be
sent to the least loaded server.
You should also take care that after SET OPTION that comes form one
client, all other SELECT commands should go to the same server, if
option that is set is affecting SELECT's.
You can measure performance of the server in several different ways,
one being number of mysqld threads running.
Regarding client - server protocol, we do have some documentation,
which can be sent to you.
____ __ _____ _____ ___ == MySQL AB
/*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped
/*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus
/*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
/*/ \*\ Developers Team