Want to receive a weekly email containing
the scoop on our new titles along with the
occasional special offer? Just click the button.
(You can always unsubscribe later by editing your
account information).

Give us an email and a password (you can use the password later to log in and
change your preferences). We'll send you a newsletter roughly once a week.

The dRuby Book: Distributed and Parallel Computing with Ruby

dRuby has been part of the Ruby standard library for more than a decade, yet few know the true power of the gem. Completely written in Ruby, dRuby enables you to communicate between distributed Ruby processes as if there were no boundaries between processes. This is one of the few books that covers distributed and parallel programming for Ruby developers.

The dRuby Book has been completely updated and expanded from its Japanese version, with three new chapters written by Masatoshi-san. You’ll find out about the design concepts of the dRuby library, and walk through step-by-step tutorial examples. By building various distributed applications, you’ll master distributed programming as well as advanced Ruby techniques such as multithreading, object references, garbage collection, and security.

Then you’ll graduate to advanced techniques for using dRuby with Masatoshi-san’s other libraries, such as eRuby and Rinda—the Ruby version of the Linda distributed tuplespace system.

In the three new chapters, you’ll see how to integrate dRuby and eRuby, get a thorough grounding in parallel programming concepts with Rinda, and create a full text search system using Drip.

Q&A with author Masatoshi Seki

A. dRuby is a distributed object system. More precisely, it’s a library for Remote Method Invocation (RMI). You can easily publish your objects to others, or call objects in other processes.

Q. How is dRuby different from other distributed object systems? What’s unique about it?

A. The biggest difference is that dRuby is designed for (and written in) Ruby. It is ridiculously easy to start using distributed object systems. dRuby inherits lots of good parts from Ruby. For example, you can use a method with block, and dRuby dynamically chooses how to send a remote object, so you don’t have to describe an interface or its transportation method.

Q. How can dRuby and distributing programming change the way we develop our apps?

A. With the rise of web services, inter-process communication became a popular way to architect systems. You can choose inter-process communication not only for large-scale systems, but also for making small tools. Consequently, we’re facing issues with dealing with inter-process communication more than ever.

With dRuby, you can concentrate on building the core of your system while dRuby takes care of the complex inter-process communication layer. The easier it becomes to write an inter-process communication layer, the more often you will choose an inter-process communication architecture when you design your system.

Q. You’ve written a few other libraries – how do they interact with dRuby and what will we find useful about them?

In my book, I used dRuby as a glue to integrate with various other libraries of mine. For example, I used it with Rinda to turn its inter-thread coordination mechanism into inter-process coordination. I also turned the ERB templating system into a separate server to minimize preprocessing cost.

Many of my libraries have profound thoughts and ideas behind a relatively small number of APIs. It’s hard to grasp the whole picture just by glancing at API references. In this book, I provide various examples for combining these libraries to reveal their full intention and usefulness.

Q. If there’s one thing we should take away from your book, what would that be?

Many of my libraries are small and simple, but with deep philosophy behind them. My goal is for you to understand the thinking behind my libraries and use this understanding to strengthen your design skills.

Don’t Get Left Out

Are your friends jealous that you get these spiffy email newsletters and they don’t? Clue them in that all they need to do is create an account on pragprog.com (email address and password is all it takes) and select the checkbox to receive newsletters.

Are you following us on Twitter and/or Facebook? Here’s where you can find us and keep up with the latest news and commentary: