www.SmarteGuru.com
  Home  |  Blogs  |  Find a Friend  |  Discussion Board  |  Resources   |  Developers Area  |  Gallery  |   Login  |  Register Now 

NeverBlock: Non-Blocking Database Adapters

NeverBlock is a library, using Ruby 1.9 fibers that allows developers to write non-blocking, concurrent code in a transparent manner. Meaning that you will keep coding in your traditional ways while you get the benefit of non-blocking IO operations.

Traditionally, a Ruby application would block whenever it requests an IO operation. This can be solved by running code in multiple threads but this comes at a cost, mainly:

1. The high overhead of threads on the execution time.
2. The complexities of the thread safety and synchronization requirement.

Another approach was to use an event based model to achieve concurrency. While these performed better they suffered from other problems, mainly:

1. The twisted model of program flow where all your code is split between callbacks.
2. The complexity of mapping an existing application to fit the above model.


NeverBlock takes a stab at the above defficencies by providng a system that has:

1. Much lower overhead on CPU and memory.
2. Much reduced synchronization complexities.
3. A Normal program flow model.
4. The Ability to adapt existing applications with little or no effort.

The first database to profit from NeverBlock was Postgres. And now, just a few days later, NeverBlock added support for MySQL as well, using the new MySQLPlus driver. MySQLPlus builds on top of the original Ruby MySQL driver but adds asynchronous query processing support and threaded access support.

There’s also another project aiming to bring asynchronous operations to Ruby’s MySQL connection called Asymy.

NeverBlock is basically the combination of Fibers, EventMachine and Postgres or MySQLPlus drivers. So the answer is yes, if you apply some small patches to it, so if you enjoy the EventMachine style of staged programming it would work with 1.8.x even.

Note that MySQLPlus already works as a thread friendlier drop in replacement for the 1.8.x MySQL drivers. It also happens to work with NeverBlock and 1.9, which is its original goal.

Social Bookmarks: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Webnews
  • Y!GG
  • Google Bookmarks
  • SEOigg
  • YahooMyWeb
  • Live-MSN
  • DZone
  • Facebook
  • Technorati
  • Ask
  • Furl
  • Spurl
  • Webbrille

Related Posts

Tags: , , , , , ,

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Viewed: 127 views

Leave a Reply

Home - About Us - Help - Terms and Conditions - Site Map - Link to Us - Resources - Contact Us
Google Rank Calculator | Suggest developer resource | Suggest Article
All rights reserved © 2007 SmarteGuru.com.