DRb and Rinda for Distributed Computation Prototyping
Posted by Eric Stewart Tue, 29 Aug 2006 03:51:51 GMT
Earlier this year I ventured back from a very enjoyable year building and deploying a project in Ruby on Rails into the familiar territory of Java. Ruby has become cemented as a valuable tool that will certainly remain near the top of my tool box, ready for use.
Right now, however, I’m working on problems that are outside the realm of where Ruby shines (though I’m certain it’ll catch up soon enough). In particular, I recently had the need to research some ideas on creating a solution for a problem that lends itself to distributed computation.
Years back I had an interest in Jini and JavaSpaces and the benefits of a Linda inspired solution. Though Sun’s JavaSpaces never seemed to become commercially successful, there are a few commercial and open source implementations out there today that make a TupleSpace (or ObjectSpace) solution an interesting option.
But Java still doesn’t lend itself well to prototyping solutions. Before spending time evaluating one of the products available today I needed to kick the tires on a TupleSpace style solution. Enter Rinda.
Rinda is a module to implement the Linda distributed computing paradigm in Ruby. It is packaged as part of the Ruby standard library and is built upon Distributed Ruby (DRb), a distributed object system for Ruby.
Since Rinda and DRb were already present in my Ruby installation, all I needed was quick start. You can find useful information on getting started in a number or places:
- Introduction to Distributed Ruby
- Lucas Carlson’s presentation on Rinda and DRb
- Ridiculously easy ways to distribute processor intensive tasks using Rinda and DRb
- How to use Ruby’s Rinda::Ring – A service locator
- Finding primes with Rinda::TupleSpace
- Ruby Cookbook – Lucas Carlson, author of one of the blog posts above, is one of the authors of this and it includes recipes for distributed problem solving
- Of course, the Ruby Standard Library docs
And of course, many many more. With the help of a couple of the resources above I was able to create a functional prototype within an hour and a half that would likely have taken days with a direct Java spike.





