Friday, September 05, 2008

New Improved MySQL library

MySQLPlus is a new, non-blocking MySQL driver for Ruby 1.8 and 1.9 (anyone know if it will run on Rubinius?) from eSpace, the folks who created NeverBlock. (They also talk about NeverBlockPG, a postgreSQL driver, but it seems to have been deleted.) To quote eSpace's announcement:
[MySQLPlus does] IO operations concurrently and in a transparent manner, thanks to NeverBlock. An interesting side effect emerged during the development of this driver. We were required to update the current MySQL driver to be able to do async operations. Once those were done, we discovered that the basic foundation for threaded support was there. Hence we went forward and implemented it (with help from Ruby gurus like Aman Gupta and Roger Pack). What we have now is a new general purpose MySQL driver that supports threaded access and async operations. This means that you can send queries to a MySQL server in a concurrent manner from Ruby applications. This is big news for those waiting for Rails thread safety. Finally there is a MySQL driver that can help them achieve that concurrency.
I'd love to see what alternative ORMs like Sequel and DataMapper will do with this kind of library underneath them.

4 comments:

oldmoe said...

PostgreSQL support for NeverBlock is safe and sound. All the work for async DB operations was done using Postgres first because of the immediate availability of the PG async APIs in the Ruby PG driver. PostgreSQL still remains the reference implementation for concurrent DB access in NeverBlock

Jeremy Nicoll said...

It is my understanding the Datamapper has it's own custom database drivers, and Datamapper is thread safe already.

oldmoe said...

That's true, DataMapper is thread safe from day one, besides, they just added support in their drivers for async MySQL and PostgreSQL operations to make real use of this thread safety.

Joshua said...

oldmoe, I dont see async support mentioned on datamapper site/doc. Got a reference I can look up? Thanks!