Chapter 20. Distributed Ruby
Many technologies that enable distributed computing are available today. These technologies include various flavors of RPC as well as such things as COM, CORBA, DCE, and Java's RMI.
These all vary in complexity, but they do essentially the same thing. They provide relatively transparent communication between objects in a networking context so that remote objects can be used as though they were local.
Why would we want to do something like this in the first place? There might be many reasons. One excellent reason is to share the burden of a computing problem between many processors at once. An example would be the SETI@home program, which uses your PC to process small data sets in the "search for extraterrestrial intelligence." (SETI@home is not a project of the SETI Institute, by the way.) Another example would be the grassroots effort to decode the RSA129 encryption challenge (which succeeded several years ago). There are countless other areas where it is possible to split a problem into individual parts for a distributed solution.
It's also conceivable that you might want to expose an interface to a service without making the code itself available. This is frequently done via a web application, but the inherently stateless nature of the Web makes this a little unwieldy (in addition to other disadvantages). A distributed programming mechanism makes this kind of thing possible in a more direct way.
In the Ruby world, one answer to this challenge is drb or distributed Ruby by Masatoshi Seki. (The name is also written DRb.) There are other ways of doing distributed coding with Ruby, but drb is arguably the easiest. It doesn't have such advanced facilities as CORBA's naming service, but it is a simple and usable library with all of the most basic functionality you would need. In this chapter, we'll look at the basics of using distributed Ruby (along with Rinda which is built on top of it).