September 10, 2006

Grafting Rails on to an existing website: The Situation

Some background is in order before we dive into the specifics of our Rails installation.

Here's the situation:

  • Our website is a mix of largely informational (static-ish) pages, and web applications.
  • We're running an intranet site that provides administrator access to many of the applications on public website.
  • We have a dedicated server running Apache.
  • The website was initially built using PHP for both "server side include"-type functionality and web applications. There is one little bit done in python, but that really doesn't factor in much here.
  • We're using MySQL as our database server. We have multiple databases running on the server.
  • For some features, we're using the Pubcookie authentication system.
  • All of this was up and running well before Rails hit version 1.0. (Not that I'm afraid of beta software, but there was *lots* of churn in Rails pre-1.0, and still a fair amount of changes to stay on top of. There is something to said for at least a little stability!)

In many ways, we're pretty typical (excepting probably the Pubcookie part).

So, why Rails? I choose Rails for many of the same reasons anyone would. I'd been growing a bit disenchanted with PHP--or rather, our ways of using it. You see, with employees and various contractors, we'd had five or six people develop various applications on our site. We had no coding conventions, and each system had its own idiosyncratic style. Maintaining these projects was becoming a pain. The Rails philosophy of "convention over configuration" had a lot of appeal in this situation. Other Rails philosophies -- "Don't Repeat Yourself" and the idea that elegant code is good code -- mapped well to my experiences as a developer.

But, I also liked Rails' deployment possibilities (Capistrano), as well as the knowledge that Rails apps could scale (with caching and multiple servers) to meet a high load. And, to cap it all off, Ruby is a nice language to work in. I had been a fan of Python, and enjoyed working with these dynamic languages. (In fact, had I not committed to Rails, I'd have probably ended up looking pretty seriously at Django.)