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

Bob Ippolito bob at redivi.com
Tue Oct 26 18:39:52 EDT 2004

On Oct 26, 2004, at 18:27, orbitz wrote:

> Seun Osewa wrote:
>> 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.
> For starters, MySQL is a really poor DBM, I suggest switching, if you 
> don't believe me:
> http://sql-info.de/mysql/gotchas.html

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.

> 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.

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...


More information about the Twisted-Python mailing list