Start reading Enterprise Rails on the free Kindle Reading App or on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here.

Deliver to your Kindle or other device

Enter a promotion code
or gift card

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Sorry, this item is not available in
Image not available for
Image not available

Enterprise Rails [Kindle Edition]

Dan Chak
4.7 out of 5 stars  See all reviews (21 customer reviews)

Digital List Price: $35.99 What's this?
Print List Price: $44.99
Kindle Price: $19.79
You Save: $25.20 (56%)

Free Kindle Reading App Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.

To get the free app, enter your email address or mobile phone number.


Amazon Price New from Used from
Kindle Edition $19.79  
Paperback $34.77  
Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

What does it take to develop an enterprise application with Rails? Enterprise Rails introduces several time-tested software engineering principles to prepare you for the challenge of building a high-performance, scalable website with global reach. You'll learn how to design a solid architecture that ties the many parts of an enterprise website together, including the database, your servers and clients, and other services as well.

Many Rails developers think that planning for scale is unnecessary. But there's nothing worse than an application that fails because it can't handle sudden success. Throughout this book, you'll work on an example enterprise project to learn first-hand what's involved in architecting serious web applications.

With this book, you will:

  • Tour an ideal enterprise systems layout: how Rails fits in, and which elements don't rely on Rails
  • Learn to structure a Rails 2.0 application for complex websites
  • Discover how plugins can support reusable code and improve application clarity
  • Build a solid data model -- a fortress -- that protects your data from corruption
  • Base an ActiveRecord model on a database view, and build support for multiple table inheritance
  • Explore service-oriented architecture and web services with XML-RPC and REST
  • See how caching can be a dependable way to improve performance

Building for scale requires more work up front, but you'll have a flexible website that can be extended easily when your needs change. Enterprise Rails teaches you how to architect scalable Rails applications from the ground up.

"Enterprise Rails is indispensable for anyone planning to build enterprise web services. It's one thing to get your service off the ground with a framework like Rails, but quite another to construct a system that will hold up at enterprise scale. The secret is to make good architectural choices from the beginning. Chak shows you how to make those choices. Ignore his advice at your peril."-- Hal Abelson, Prof. of Computer Science and Engineering, MIT

Editorial Reviews


Enterprise Rails is indispensable for anyone planning to build enterprise web services. It's one thing to get your service off the ground with a framework like Rails, but quite another to construct a system that will hold up at enterprise scale. The secret is to make good architectural choices from the beginning. Chak shows you how to make those choices. Ignore his advice at your peril. --Hal Abelson, Prof. of Computer Science and Engineering, MIT

About the Author

Dan Chak's varied education in real-world web architecture gives him a unique perspective on the challenges of building rock-solid web applications. Dan has worked at, the world's biggest online retail store, where seemingly small technology problems become big ones due to enormous scale. Dan also directed software development at CourseAdvisor Inc., a Ruby on Rails startup company. A nearly instant success, CourseAdvisor was acquired by the Washington Post Company in October 2007. You can hear his thoughts on his blog at

Product Details

  • File Size: 2359 KB
  • Print Length: 352 pages
  • Page Numbers Source ISBN: 0596515200
  • Simultaneous Device Usage: Unlimited
  • Publisher: O'Reilly Media; 1 edition (October 21, 2008)
  • Sold by: Amazon Digital Services, Inc.
  • Language: English
  • ASIN: B0026OR380
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • Lending: Not Enabled
  • Amazon Best Sellers Rank: #890,925 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?

Customer Reviews

Most Helpful Customer Reviews
20 of 20 people found the following review helpful
Format:Paperback|Verified Purchase
Dan Chak has written a really excellent introduction to enterprise web application architecture, and a worthy candidate for your technical bookshelf.

Calling it "Enterprise Rails" is a bit misleading, though. Rails only makes fleeting appearances. There's a great introduction to Rails plugin writing, which rightfully urges developers to move any decorator code to plugin modules. He talks a little about segmenting class files along Physical, Logical and Service boundaries, the point of which I have yet to understand completely. And there's a chapter on pushing Rails' application-layer polymorphism down to the data layer, which is good advice, but more on that later.

The bulk of Enterprise Rails is devoted to building a solid data layer. Again, good advice. The Rails team decided that referential integrity and validation belongs in the application layer, which Chak contends is dangerous (and I believe him). However, this is where things start to get a little hairy - enforcing referential integrity and validation in the data layer requires an early and continued adherence to SQL, and Chak makes it clear that any old SQL won't do: it's PostgreSQL or nothing.

This makes fully half of the book a dissertation on SQL domain description language from the Postgre perspective, domain data, third normal form and other data layer topics. I have greatly enjoyed the introduction to Postgres DDL, but it wasn't exactly what I expected from a Rails book.

The last few chapters are mostly about Service Oriented Architecture (which I suspect is why most people buy this book) and caching. Chak shows why he's an expert in enterprise software architecture here. But again, he takes a decidedly anti-Rails approach, emphasizing ActionWebService and XML-RPC.
Read more ›
Comment | 
Was this review helpful to you?
8 of 8 people found the following review helpful
4.0 out of 5 stars Not Your Typical Rails Book December 18, 2008
By Larry
Dan Chak is obviously one smart guy, and I agree with the other reviewers in that this book provides a lot of information not found in any other Rails books.

I have neither the advantage nor experience of working on a large, complex site like Amazon (where Dan worked), so for all I know maybe all of his ideas border on necessity for a site of that complexity. But there does seem to be a lot of straying from the normal philosophies espoused in virtually every other Rails book.

For example, he eschews migrations and instead does all schema manipulation via SQL DDL statements. And choosing PostgreSQL over MySQL means that on more than one occasion MySQL users are left trying to figure out how to accomplish what he has just covered.

None of which is bad; heck, Rails is Latin for "opinionated", right? But if you're in a fairly small shop working on non-Amazon-size websites (which most of them are), I question how many of these fairly complex strategies will be implemented given the perpetual "behind schedule" state we all seem to be in most of the time, not to mention the pressures of "getting something out the door" as soon as possible.

Regarding this issue, I think he himself put it best during his discussion of REST vs. XML-RPC vs. SOAP: "... we must remind ourselves that in the enterprise practicality is at least as important as purity." (Ada, anyone?)

While we all know that "pay me now or pay me later" and "an ounce of prevention is worth a pound of cure" are absolute truths, the real world often dictates we ditch these proverbs.

Regardless, I think this book is a must-read for serious Rails developers. Dan raises a heckuva lot of good points that you won't find anywhere else.
Comment | 
Was this review helpful to you?
3 of 3 people found the following review helpful
5.0 out of 5 stars Required reading for any rails developer February 5, 2010
By Tom
Format:Paperback|Verified Purchase
The author provides an important perspective that can easily be forgotten in the rails community. You may not put into practice everything you find in the book but it is an invaluable, intelligent description of design strategies that need to be re-aquired in the rails community if it wants to survive beyond "this is a really cool language!" ;)
Comment | 
Was this review helpful to you?
1 of 1 people found the following review helpful
5.0 out of 5 stars Still unique, still deeply relevant and important November 2, 2013
Many of the other reviews have sung this book's praises, so I will only add that as of 11/2/2013, this book is still deeply relevant and is still unique. Its primary value is to remind us Rails and Rubists, who look down on PHP and tend to think that we live in a city upon the hill, that convention over configuration is not enough to make a rock solid enterprise web app. In fact, you must delve into SQL, you must twist Rails' arm a bit to get your namespaces implemented correctly, etc. You will still be able to apply 90%, if not 100%, of the tutorials and lessons in this book in Rails 4.0 with Ruby 2.0.

The most helpful part for me was the four chapters devoted to database design and theory, especially Dan's introduction to third normal form. I suspect that new readers will find his advice to eschew Ruby migrations in favor of straight SQL to be the most controversial aspect of this book, but his argument is solid.

As another reader mentioned, there are a few typos, but none that get in the way of understanding the material. The book's most important "shortcoming" in 2013 is that Rails' plugin architecture has changed dramatically, and almost no one seems to be using the old Rails 2-style plugins discussed in the book. The community has instead moved toward gems and mountable engines, and a lot of gems have since been created that address some of Rails' problems. I actually created one myself (enterprise_mti, search on GitHub or download with RubyGems) for implementing multiple table inheritance using the principles and code found in this book. (Also, check out SchemaPlus, SchemaValidations, and SchemaAssociations for implementing database referential integrity in migrations.
Read more ›
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
3.0 out of 5 stars Needs some updates and title change
The author see's the sql database as the center and stronghold of his application. So the pages 40-180 tell's you, how to normalize you'r db, use constraint's to enforce... Read more
Published 16 months ago by Dieter Späth
4.0 out of 5 stars Nothing Is timeless
My edition was written in 2008, and lots of things in Rails have moved on since then. However, this book is still a great read for the many other aspects that are rarely addressed... Read more
Published on November 8, 2011 by DAVID
5.0 out of 5 stars n-tier intro, Rails style
Hi, I enjoyed this book. Didn't understand when the sledding got rough, but it certainly helped me understand what the noise about n-tier is all about. Read more
Published on March 25, 2011 by John S. Benson
5.0 out of 5 stars Solid web enterprise patterns
Regardless that the technology is Rails and Postgres -centric, the text is solid about proper enterprise architecture. Read more
Published on December 3, 2010 by High Pockets
5.0 out of 5 stars Awesomely useful book
I just finished Enterprise Rails and want to tell you what a capital, outstanding, helpful book it is. I was sad when I finished it! Read more
Published on August 19, 2010 by Amazon Customer
5.0 out of 5 stars Must read before you develop enterprise application.
It addressed the real world problems of Rails. It's emphasized the organization and code sharing when you put the Plugin chapter at the very beginning of the book. Read more
Published on October 12, 2009 by S. Kanakakorn
5.0 out of 5 stars Must have book for building scalable enterprise Rails apps
I bought this book based on a recommendation from a friend and I'm so glad that I did. While I was expecting the book to walk through ways to architect scalable Rails... Read more
Published on August 19, 2009 by R. Barrett
5.0 out of 5 stars No buzzwords!
In a Rails world full of buzzwords and magic, this book brings you exactly where you have supposed to be when programming in the enterprise with the framework we all love. Read more
Published on May 19, 2009 by Costa Michele
5.0 out of 5 stars Get this book if you are serious about rails.
This is my first ever review. Oddly none of the other technical books (over 300) that I read ever compelled me write before. Read more
Published on April 5, 2009 by farout
4.0 out of 5 stars Thought provoking
Enterprise Rails is a much needed addition to the space. This book became required reading for our development staff while we pondered over our potential product... Read more
Published on February 20, 2009 by Michael Kintzer
Search Customer Reviews
Search these reviews only

More About the Author

Discover books, learn about writers, read author blogs, and more.

What Other Items Do Customers Buy After Viewing This Item?


Have something you'd like to share about this product?
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for Similar Items by Category