The dRuby Book


Preface

Stateful web servers are a core concept of dRuby. dRuby lets you pass normal Ruby objects and call their methods across processes and networks seamlessly. With dRuby, you’ll experience the world of distributed computing as a natural extension of Ruby.

The most widely used distributed system in the world is probably the Web. It’s one of the most successful ways to distribute documents around the world—and dRuby’s history is related to the Web. Back when Ruby was still in version 1.1, a web server called shttpsrv was available. shttpsrv was similar to WEBrick, but WEBrick was so innovative that Shinichiro Hara—one of the core committers of Ruby and the author of shttpsrv—decided to ditch the new version of shttpsrv in favor of WEBrick (which now comes as part of Ruby’s standard libraries). But I really liked the small and cool web server called shttpsrv, so I wrote a servlet extension for it. With this extension, shttpsrv transformed from an ordinary web server to a special TCP server with state. And that is how dRuby started.

This is the third edition of The dRuby Book (the previous two editions were in Japanese). For this edition, I’ve rewritten the book to cover the latest dRuby information and new libraries. If you are looking for theoretical definitions of distributed objects or detailed comparisons of various systems, look elsewhere! This book is full of hands-on exercises and interesting code examples. I hope you put this book to use by writing code as you read and discovering new things along the way.

Ruby changes your thinking process, and so does dRuby. dRuby is not just a tool to extend a method invocation. You’ll discover new techniques, programming styles, and much more as you learn how dRuby works.

dRuby will show you a side of Ruby you’ve never seen before. Let’s explore together!