[Twisted-Python] adbapi MySQL read/write splitting
Alvin Delagon
adelagon at gmail.com
Tue Aug 31 21:13:00 MDT 2010
Used to wrap MySQLdb for something like except that I did it for sharding.
It worked well on distributing load across multiple database servers. I
think the guys from my former company updated the wrapper to use adbapi.
- Alvin
On Wed, Sep 1, 2010 at 10:54 AM, Jason J. W. Williams <
jasonjwwilliams at gmail.com> wrote:
> That's one way of handling it. Another way is to wrap the library so
> it does the splitting automatically. The advantage to the latter is
> not making mistakes where you accidentally use the READ connection for
> a write. For non-async Python there are some tools like SQL Relay
> which will do this for you, but you have to setup SQL Relay servers
> and use the SQL Relay dbapi driver. MySQL Proxy will also do it, but
> it's not very stable.
>
> I was somewhat hoping someone had already written a wrapper for doing
> the splitting. Which brings me to a related question...if I were to
> write a wrapper to do the splitting, would wrapping MySQLdb be
> sufficient? Or would wrapping adbapi be the better path?
>
> -J
>
> On Tue, Aug 31, 2010 at 8:40 PM, Itamar Turner-Trauring
> <itamar at itamarst.org> wrote:
> > On Tue, 2010-08-31 at 20:36 -0600, Jason J. W. Williams wrote:
> >> Sending writes (e.g. INSERTs and UPDATEs) to a master MySQL server and
> >> reads (SELECTs) to a slave.
> >
> > So... two adbapi.ConnectionPool instances, one for the server, one for
> > the slave?
> >
> >
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python at twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> >
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
--
http://www.alvinatorsplayground.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20100901/3313031c/attachment.html>
More information about the Twisted-Python
mailing list