Deploying Rails Applications Book Review
When I first received Pragmatic Bookshelf's Deploying Rails Applications: A Step By Step Guide by Rails community superstar Ezra Zygmuntowicz and authoring partners Bruce Tate, Clinton Begin with Geoffrey Grosenbach and Brian Hogan, I expected to finish reading this 260+ page book in a single sitting. After all, what was so special and challenging about SCP'ing files via rsync?
Ezra, who co-founded Rails hosting company Engine Yard (check out my two part interview with Engine Yard CTO Tom Mornini for more about the company and some of the Ruby projects Ezra is responsible for there), shares his experiences and certainly elevated my understanding and appreciation for the complexities of deploying a manageable, repeatable, scalable Rails application.
Anyone who has written even a simple Rails app for more than a handful of end users will be familiar with Rails-related technologies like Capistrano and Mongrel but learning the ins, outs and best practices of these tools for me was a process of culling through spotty online documentation, newsgroup, IRC and various forum postings and more occasionally than not, trial and error. Fortunately for those tasked with not only writing a Rails application but also responsible for its care and feeding in a released production environment state, Deploying Rails Applications is a remarkably helpful manual.
The book begins with what should be obvious to any rational developer - the need for source control management (to quote the authors, "Running without version control these days is madness"). Subversion is the tool of choice and is used as the SCM model throughout the book. While its promotion of SVN is adequate, I would have also liked the authors explore a tool like Git to show how other source controls options could have been used in this context. Once convinced that using something like SVN lies at the heart of a sustainable deployment, the book moves on to preparing code for production via isolating those files to be SVN-managed, database configuration, migration and security considerations, and deciding between a shared hosting or a dedicated server with or without a virtual machine environment.
Mid-way through the book, Chapter 5 discusses the relatively powerful automated application deployment tool Capistrano. This evolving utility honestly deserves a book of its own; I suspect it won't be very long before a Capistrano Cookbook appears on the shelves, extolling the virtues of this tool that can be used far beyond its Rails application deployment roots. However, in the scope of this book, its use zeros in on a strict scenario - pushing out a Rails app to a server host(s) in a robust and repeatable fashion. It is the hard earned details that prop the value of Deploying Rails Applications beyond the README's and buried threads available to anyone patient enough to dig for them on the Internet. For the rest of us who are constantly pressured by deadlines and commitments, the succinct steps and explanations in this chapter save both time and sanity.
Once the basics of Capistrano are grok'd, it's on to the task of clustering Mongrels. Mongrel, for the Rails-uninitiated, is a Ruby-based application server that "is rapidly becoming the defacto standard for serving Rails applications." Like the chapter on Capistrano, the three chapters on Mongrel configuration, clustering and performance optimization will be priceless to organizations basing their business on the Rails framework. Lastly, the book concludes with a brief 4 page chapter on the future of Rails deployment, touting that the landscape will continue to shift thanks to the rapid evolution of the base technology coupled with next generation Ruby interpreters like Yarv, Rubinius, JRuby and IronRuby.
Deploying Rails Applications is a must-have title for Rails developers and maintainers. Like most Pragmatic Bookshelf titles, its content is free of superfluous fluff and impractical theory and instead is a gift of valuable information for developers and sysadmins who are being faced with the realization that a more capable and sane solution beyond rsync for Rails app deployment does indeed exist.