Deploying with JRuby: Deliver Scalable Web Apps Using the JVM – It’s the simpler & better solution? – #bookreview

Deploying with JRuby: Deliver Scalable Web Apps Using the JVM
Joe Kutner
(Pragmatic Bookshelf, paperback)

Many developers are using Ruby on Rails to create web applications. But the supporting infrastructure often can be complex. And when a problem occurs, there is no centralized management interface to help you quickly determine what has gone awry.

There is a simpler and better solution, says JRuby specialist Joe Kutner in his new book. “The recent growth and increased adoption of the Java Virtual Machine (JVM) as a platform for Ruby applications has opened many new doors. Deployment strategies that were not possible with MRI [Matz’s Ruby Interpreter] Ruby are now an option because of the JVM’s built-in management tools and support for native operating system threads. Ruby programmers can leverage these features by deploying their applications on JRuby.”

Kutner’s 199-page book focuses on how the JVM can offer deployment choices that are “much better options than both Ruby and Java programmers are used to.” He describes “the most popular and well-supported for deploying JRuby. There is,” Kutner says, “a surprising amount of flexibility in the processes and platforms that can be used, which allows Ruby and Java programmers to tailor their deployments to suit many different environments.”

Deploying with JRuby has 10 chapters:

  • Getting Started with JRuby
  • Creating a Deployment Environment
  • Deploying an Archive File
  • Creating a Trinidad Application
  • Deploying a Trinidad Application
  • Creating a TorqueBox Application
  • Deploying a TorqueBox Application
  • Clustering a TorqueBox Application
  • Managing a JRuby Deployment
  • Using a Continuous Integration Server

Kutner points out that production JRuby environments have “fewer moving parts than traditional Ruby environments. This is possible because of the JVM’s support for native operating system threads. Instead of managing dozens of processes, JRuby can use multiple threads of execution to do work in parallel. MRI has threads, but only one thread can execute Ruby code at a time. This has led to some complex workarounds to achieve concurrency.”

His book is written smoothly and to the point, and there are numerous illustrations and procedure steps. He also offers a “no-Java-code promise,” stating: “You will not have to write any Java code as you work your way through this book….The technologies and tools that you will be introduced to in this book hide the XML and Java code from you.”

Still, you are free to include Java code or make calls to Java libraries, if you want to, he adds. Or you may, as many others do, choose to write programs “exclusively in Ruby and deploy them on the Java Virtual Machine….There are many reasons,” Joe Kutner says, “to deploy Ruby applications on the JVM, and using Java libraries and APIs is just one of them.”

Si Dunn