The MySQL Replication allows to scale out read-load.
To use it nicely your application has to be aware of reading data from slaves and writing data to the master. Read/Write splitting wants to automate that process inside the MySQL Proxy.
a Proof of Concept of that idea is presented.
There are a few problems left before that feature is in a acceptable state:
Up to now the example script only knows about:
Currently most of the other commands that change the connection state are ignored.
The rw-splitting.lua script has to be extended to track those statements and either:
The MySQL Proxy maintains a connection pool if the scripting layer disconnects the backend from the client connection:
proxy.connection.backend_ndx = 0
The backend connection can be taken from the pool by other client connections afterwards.
For the R/W-Splitting you need 2 open connections for each client connection:
As the authentication protocol never transmits the real password nor anything we can use to authenticate against another server, we need a internal storage of credentials to open connections to the backend-servers when we are short of connections in the pool.
That's currently missing.
Yes, we know that RW-Splitting is not for production use yet, it is a Proof of Concept. To keep track of the known issues:
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/90618/viewspace-776258/，如需转载，请注明出处，否则将追究法律责任。