MySQLPlus: A Non-Blocking MySQL Driver for Ruby 1.8 and 1.9
Recently we posted about NeverBlock, a Ruby 1.9-specific library that eases the development of apps that use non-blocking IO. eSpace, the company behind the library, have now come along with another surprise... MySQLPlus - a non-blocking MySQL driver for Ruby 1.8 and 1.9! There's more information here in the official announcement.
MySQLPlus is billed as a new general-purpose MySQL driver that supports "threaded access and async operations," offering developers a robust tool to streamline their database interactions. Imagine the same principle applied to optimizing platforms with high traffic and demand for seamless user experiences, like casino sites not on Gamstop, which rely heavily on low-latency solutions to provide uninterrupted services. After installing MySQLPlus and running the basic tests that come with the library, it certainly seems to deliver on its promises. eSpace believes that MySQLPlus could be instrumental in significantly reducing the latency of certain Rails applications. This makes it a particularly valuable resource for developers creating high-demand systems where swift and reliable database responses are non-negotiable. As a bare MySQL driver, it offers significant benefits to all Ruby developers whose code interacts with MySQL servers. If your project involves such systems, especially in environments where speed is crucial, like gaming platforms, try out MySQLPlus now—your Ruby processes will thank you for the relief.
This post supported by Notifixious - Notifixious - a new notification service startup based in San
Francisco - needs a Rails expert to become its CTO! Knowledge of messaging technologies (XMPP) and REST API development is a must. You can learn more here.
September 3, 2008 at 11:57 pm
Awesome news!!! Ruby is gearing towards an Async world very fast.
September 4, 2008 at 12:51 am
I am wondering how this will affect the common Rails CRUD sites that use the standard Rails conventions.
Would this make any difference if used in place of the mysql-ruby gem ?
Or would this only be of interest to apps that are doing all sorts of hackish things with ActiveRecord::Base.connection directly in their code, such as managing a database connection pool?
I'm just trying to see what this all means.
September 4, 2008 at 1:42 am
@John, seems like anything that depends on a DB query would benefit from this. AR or otherwise if the site makes a db hit per request I'd think it would benefit from the async. I'd love to combine this with merb's run_later for things like hit counting.
September 4, 2008 at 4:51 am
There's more extensive information in an interview with one of the Neverblock developers over @ InfoQ:
http://www.infoq.com/articles/fibers-neverblock-revactor
September 4, 2008 at 4:59 am
@John: You are right, Rails applications that follow the standard way cannot benefit from MySQLPlus yet. However, it's good to know that eSpace is just about to release an ActiveRecord adapter (among other NeverBlock stuff) that would benefit from MySQLPlus. after the adapter is released, it will be a matter of configuring your Rails application to use it along with MySQLPlus, and everything wlse will be just seamless.. You'll continue writing code the way you have always been doing, but you'll gain the massive performance boost.
September 4, 2008 at 7:40 pm
it is a good start to have thread safe rails 2.2 with thread safe db driver,
hope people start posting their benchmarks,
hope someone builds a tool for connection pooling as well
September 4, 2008 at 9:44 pm
this is great news.
between rails 2.2 and this new mysql driver, we'll be entering into a new generation of development and support soon.
September 5, 2008 at 2:48 pm
Awesome news, but completely irrelevant for Rails production systems at this point in time. ALL these drivers require 1.9 and there is no news on the horizon that Rails is going to be 1.9 stable any time soon. In fact, Matz has even said 1.9 itself should not be considered stable.
We're not going to see any of these drivers put into production until sometime next year probably. These non-blocking drivers have been making the rounds on all the news sites and that's good, but people need to realize that they're completely alpha at this point in time and are no where near being available as a usable gem that Rails can deploy on.
The next biggest news for Rails, besides being thread safe in 2.2 will be Rails on 1.9.x. Watch out for that.
September 5, 2008 at 3:41 pm
Jay: "ALL these drivers require 1.9" ? I'd be interested to hear more, but this works fine on 1.8 for me and is non-blocking as claimed.
To your other point, 1.9 should be considered stable on the release of 1.9.1 which is supposedly production ready. Whether Rails will work with it is a different issue, of course :)
September 6, 2008 at 4:52 pm
@Jay MysqlPlus is compatible with 1.8 and 1.9. You could use it with rails 2.2 to have a more "ruby thread friendly" rails app that doesn't block on IO--whenever 2.2 comes out, that is :)
MysqlPlus is a fork off the [already stable] Mysql C gem, so it should be near production ready [many thanks to Tomahito M.].
1.9 will theoretically be "stable" at the end of this year [whatever that means], I probably wouldn't recommend upgrading until...at least a little while after that :)
AFAIK all rails' tests pass in Ruby 1.9 so you can run it and try it yourself :)
@Senthil: Note that rails 2.2 will come with pooled db connections [you set the size in the database.yml descriptions].
September 7, 2008 at 9:42 pm
I think this is awesome. But does anyone else feel a little skeptical about upgrading to ruby 1.9, rails 2.2, and throwing a new mysql driver at your production environment?
September 9, 2008 at 9:58 pm
Yeah if you want rails mysql multi threaded I'd probably just upgrade to mysqlplus + rails 2.2 [staying with 1.8.6] until the dust settles a little more. I guess it depends how aggressively you want to upgrade [or need to or what not].
-=R