[Twisted-Python] Case for an Async MySQL Driver?

Hi, I'm new to Twisted, and I was just thinking about how, while 'twisted.enterprise.adbapi' is is a really neat idea, it's sort of a stop-gap solution pending the time async database drivers can be integrated into Twisted. It's not 'right' to have 1 python thread and 1 mysql server thread/process for each connection. How about an event-driven MySQL protocol implementation that fits into the Twisted Framework? (I came accross a MySQL protocol specification online once but I think I've lost it). If this sounds sensible, I'll be interested with helping out with implementation but I won't be able to do actual coding for some time. Regards, Seun.

On Tue, 26 Oct 2004 16:05:13 +0100, Seun Osewa <naijasms@gmail.com> wrote:
It sounds like a fine idea, and several people have attempted doing native async protocol implementations for database systems in the past, but nobody's finished and/or maintained them. So, patches accepted. ;-) -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com

On Wed, 27 Oct 2004 09:02:16 +1100, Christopher Armstrong <radeex@gmail.com> wrote: ...
Considering the fact that I'm a python newbie _and_ have newer submitted a patch to any open source project before, it might take a considerable while for any working code to become available. I'll be posting questions about how the implementation _should_ be integrated into Twisted, partly as a way of getting to understand Twisted better. Here's the MySQL protocol link http://www.redferni.uklinux.net/mysql/MySQL-Protocol.html The most important details seem simple enough. Wish I could learn why other would-be implementors lost interest. Regards, Seun

For starters, MySQL is a really poor DBM, I suggest switching, if you don't believe me: http://sql-info.de/mysql/gotchas.html Secondly, adbapi is made in such a way that it doesn't care which module you use as long as it is DB-API 2.0 compliant (2.0 right?). There is a postgresql module which provides async access to a postgresql db, however it is not DB-API compliant so twisted cannot use it. If you can fit an async MySQL API into DB-API compliance, kick ass, but otherwise having a twisted specific module for MySQL kind of defeats the purpose of having DB-API. Finally, will the MySQL lib even allow you to do non blocking calls to the database? If not then that sounds like a major pitfall there. Seun Osewa wrote:

On Oct 26, 2004, at 18:27, orbitz wrote:
All of the RDBMS have their pros and cons... I personally think the worst thing about MySQL is the license in most cases, but it's obviously good enough for most people.
This is all redundant. adbapi depends on DB-API, and DB-API is *synchronous*. If you want an asynchronous interface you are already "defeating the purpose of having DB-API". He didn't say anything about the MySQL lib, he said protocol specification. If you implement the protocol yourself, you can make it as asynchronous as you want... -bob

On Tue, 26 Oct 2004 16:05:13 +0100, Seun Osewa <naijasms@gmail.com> wrote:
It sounds like a fine idea, and several people have attempted doing native async protocol implementations for database systems in the past, but nobody's finished and/or maintained them. So, patches accepted. ;-) -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com

On Wed, 27 Oct 2004 09:02:16 +1100, Christopher Armstrong <radeex@gmail.com> wrote: ...
Considering the fact that I'm a python newbie _and_ have newer submitted a patch to any open source project before, it might take a considerable while for any working code to become available. I'll be posting questions about how the implementation _should_ be integrated into Twisted, partly as a way of getting to understand Twisted better. Here's the MySQL protocol link http://www.redferni.uklinux.net/mysql/MySQL-Protocol.html The most important details seem simple enough. Wish I could learn why other would-be implementors lost interest. Regards, Seun

For starters, MySQL is a really poor DBM, I suggest switching, if you don't believe me: http://sql-info.de/mysql/gotchas.html Secondly, adbapi is made in such a way that it doesn't care which module you use as long as it is DB-API 2.0 compliant (2.0 right?). There is a postgresql module which provides async access to a postgresql db, however it is not DB-API compliant so twisted cannot use it. If you can fit an async MySQL API into DB-API compliance, kick ass, but otherwise having a twisted specific module for MySQL kind of defeats the purpose of having DB-API. Finally, will the MySQL lib even allow you to do non blocking calls to the database? If not then that sounds like a major pitfall there. Seun Osewa wrote:

On Oct 26, 2004, at 18:27, orbitz wrote:
All of the RDBMS have their pros and cons... I personally think the worst thing about MySQL is the license in most cases, but it's obviously good enough for most people.
This is all redundant. adbapi depends on DB-API, and DB-API is *synchronous*. If you want an asynchronous interface you are already "defeating the purpose of having DB-API". He didn't say anything about the MySQL lib, he said protocol specification. If you implement the protocol yourself, you can make it as asynchronous as you want... -bob
participants (5)
-
Bob Ippolito
-
Christopher Armstrong
-
Nick Arnett
-
orbitz
-
Seun Osewa