Watch_me

Deploy using the JVM’s high performance while building your apps in the language you love. JRuby is a fast, scalable, and powerful JVM language with all the benefits of a traditional Ruby environment. See how to consolidate the many moving parts of an MRI-based Ruby deployment onto a single JVM process. You’ll learn how to port a Rails application to JRuby, get it into production, and keep it running.

Paperback list price normally $33.00, now on sale for $9.95 while supplies last.

Buy Now

Select a DRM-free Format:

In Stock
In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle, and your Dropbox. (You'll need to log in to enable these options.)
 

About this Book

  • 224 pages
  • Published:
  • Release: P1.0 (2012-07-09)
  • ISBN: 978-1-93435-697-5

NEW: See this video on using Torquebox for high-availability deployment on the JVM.

JRuby deployments have fewer moving parts and consume less memory than traditional Ruby deployments, but to deploy your apps on the JVM, you need to learn some new approaches. This book introduces you to three JRuby deployment strategies that will give you the performance and scalability you need while letting you use the language you love.

You’ll start by porting an existing application to JRuby, preparing the app to take advantage of the JVM platform. Then you’ll use Vagrant and Puppet to build a virtual production environment so you have a stable, reproducible place to explore JRuby deployment.

With your environment in place, you’ll experiment with simple JRuby deployment with Warbler as you package your Ruby web application into a single file you can deploy to a Java application server. Next you’ll set up the lightweight Trinidad web server to create a more flexible, modular deployment that fits more complex situations but still feels friendly and familiar to Ruby developers. You’ll switch to powering your app with TorqueBox, an all-in-one JRuby environment that includes built-in support for messaging, scheduling, and daemons—perfect for handling the “big jobs.” Then, you’ll set up a continuous integration environment with Jenkins so you can deploy like the pros.

Deploying with JRuby is the missing link between enjoying JRuby and using it in the real world to build high-performance, scalable applications.

Want to see how easy it is to do? Watch the video above.

What You Need:

To run the examples in this book, you’ll need a computer that can run the Java Virtual Machine.

Contents and Extracts

Preface

  • Getting Started with JRuby
    • What Makes JRuby So Great? excerpt
    • Introducing Warbler excerpt
    • Preparing Twitalytics for JRuby
    • Configuring Warbler for Twitalytics
    • Wrapping Up
  • Creating a Deployment Environment
    • Creating a Virtual Server excerpt
    • Provisioning with Puppet
    • Packaging the Deployment Environment
    • Using Alternative Platforms
    • Wrapping Up
  • Deploying an Archive File
    • Provisioning a Server
    • Installing Apache Tomcat
    • Creating the Deployment Script
    • Using Precompiled Assets with Warbler
    • Deploying to the Cloud
    • Wrapping Up
  • Creating a Trinidad Application
    • What is Traditional Deployment
    • Getting Started with Trinidad
    • Adding Trinidad Extensions
    • Choosing Alternatives to Trinidad
    • Wrapping Up
  • Deploying A Trinidad Application
    • Provisioning a Server
    • Installing Trinidad as a Service
    • Hot-Deploying with Capistrano
    • Configuring Apache
    • Choosing Alternative Deployment Strategies
    • Wrapping Up
  • Creating a TorqueBox Application
    • What is an Application Server
    • Getting Started with TorqueBox
    • Creating a Deployment Descriptor
    • Using the Management Console
    • Scheduling a Recurring Job
    • Creating a Long-Running Daemon
    • Running Background Jobs
    • Pushing to the Browser with Stomplets
    • Testing a TorqueBox Application
    • Wrapping Up
  • Deploying a TorqueBox Application
    • Choosing a Deployment Strategy
    • Creating a Deployment Environment
    • Installing TorqueBox
    • Deploying an Archive File
    • Wrapping Up
  • Clustering a TorqueBox Application
    • Creating the Cluster
    • Installing the Apache Cluster Module
    • Deploying to the Cluster
    • Using High-Availability Jobs and Services
    • Using Session Replication
    • Running in Domain Mode
    • Wrapping Up
  • Managing a JRuby Deployment
    • Configuring the Runtime
    • Inspecting the Runtime with JMX
    • Managing the Runtime with JMX
    • Creating a Management Bean
    • Profiling an Application
    • Wrapping Up
  • Using a Continuous Integration Server
    • Installing Jenkins
    • Creating a Git Depot
    • Creating a Jenkins Job
    • Archiving Artifacts with Jenkins
    • Wrapping Up

About the Author

Joe Kutner has been building JRuby applications since 2006 for clients including IBM and NASA. Today, he is a professional software consultant building Ruby and Rails applications for customers of all sizes. Joe also contributes to several JRuby projects including TorqueBox and Trinidad.

Comments and Reviews

  • Within half an hour of picking up this book I found a solution to a deployment problem I’ve had for months. Loaded with solid insight and relevant examples, this book is a must-have if you’re looking for an approach to deployment that doesn’t involve holding your breath.

    —Bryan Powell Founder of Metabahn, creator of Pakyow
  • Deploying with JRuby is an invaluable resource for anyone planning on using JRuby for web-based development. For those who have never used JRuby, Joe clearly presents its many advantages and few disadvantages in comparison to MRI.

    —Toby Crawley TorqueBox developer at Red Hat
  • Deploying with JRuby is a must-read for anyone interested in production JRuby deployments. The book walks through the major deployment strategies by providing easy-to-follow examples that help the reader take full advantage of the JRuby servers while avoiding the common pitfalls of migrating an application to JRuby.

    —Ben Browning TorqueBox developer at Red Hat
  • Essential reading to learn not only how to deploy web applications on JRuby but also why.

    —David Calavera Creator of Trinidad
  • This book is an excellent guide to navigating the various JRuby deployment options. Joe is fair in his assessment of these technologies and describes a clear path for getting your Ruby application up and running on the JVM.

    —Bob McWhirter TorqueBox team lead at Red Hat
  • Deploying with JRuby answers all of the most frequently asked questions regarding real-world use of JRuby that I have seen, including many we were not able to answer in Using JRuby. Whether you’re coming to JRuby from Ruby or Java, Joe fills in all the gaps you’ll need to deploy JRuby with confidence.

    —Nick Sieger JRuby Core team member and coauthor, Using JRuby
  • Deploying with JRuby is the definitive text on getting JRuby applications up and running. Joe has pulled together a great collection of deployment knowledge, and the JRuby story is much stronger as a result.

    —Charles Oliver Nutter JRuby Core team member and coauthor, Using JRuby