Imploding Rails, Jesus DHH, and The Uncle Ben Principle

Update: I've responded to many of the comments below here I love Rails - let me just get that out of the way right now. As many who've read my blog know, I think it's the Dog's Bollucks in terms of a developer's framework. But that seems to be a problem with Rails - the focus is on rapid development only. What happens after that is up to you.


Rails is a Developer’s Framework. Built by egomaniacal developers, for developers

Did I mention that I love Rails? A lot of people have suggested that if I love Rails so much, I should just become a Rails developer:

Dude if you love Rails so much, why don’t you just marry it?

Good idea. The problem is that I’d like to actually STAY MARRIED and not get a divorce as soon as my server CPU pegs and my client fires me because my app won’t scale. In addition the project seems to have been hijacked by a foul-mouthed prissy Dane who has a Jesus Complex. Seriously – how far can I go with this kind of inattention to things that are really, really important?

Dude, Killer Set of Unit Tests. Can I See Under the Hood?
A developer’s platform is awesome in theory – the problem is that it’s "too vertical" – in other words it’s too specialized for one purpose. There are reasons why people don’t drive around cars that were "built by mechanics, for mechanics" (we’d all end up driving around 1968 Capris) and houses that were "built by plumbers, for plumbers" (but can you imagine the dishwasher)! When I first tried Rails I remember the feeling of freedom and longing for something new. It was almost pubescent. I wanted to throw all things ASP.NET out the window, grab my Mac, and become radical like Morpheus. My wife liked the leather idea, but when I shaved my head she put a stop to the whole thing. This is what the owner of CD Baby (Derek Sivers) said about Rails when he first messed with it just two years ago:

Like a lost soul walkin’ the earth, lookin’ for spirituality, that stumbles upon the right church with the right people at the right time, I’ve found my niche with Ruby. Its little itty-bitty community attracts some brilliant “think different” types with a love for beautiful code that do this for love, not money.

He then committed to rebuilding all of CD Baby using Rails:

Since all existing code is built around some real fundamental flaws, a total rewrite is not just a necessity but very exciting. <snip> Rails expert Jeremy Kemper is doing the most work, up-front, and Tobias Luetke is on board to help too. We’ll be contributing all changes back to the Rails code repository.

I gotta tell ya, after reading this I was looking for any reason I could find to jump the fence like Mike Gunderloy and become a Rails programmer. This lasted for 15 minutes until I looked across the room at my family and realized they couldn’t live off beer and Cheeze Whiz as easily as me. But I must admit, I was hooked…

DHH – You Got My Back With This Stuff?
The Rails dudes are pretty damn smart. But they’re also pretty damn arrogant. As DHH says:

I’m not in this world to create Rails for you. I’m in this world to create Rails for me and if you happen to like that version of Rails that I’m creating for me, than you are going to have a great time.

One of the more shocking presentations I’ve ever seen involves DHH telling his audience who he’s writing Rails for, and why he doesn’t really listen to the community when they suggest where he should take it: dhh_fu Maybe it’s a language thing – those Euro guys can swear a lot. Maybe "Fuck You" means something different in Copenhagen? I’m sure that Biz Stone has an idea as to what it means (and I’m sure he’s said it a few times, aimed at Denmark) – he’s got a business built on top of Mr. Potty Mouth’s software…

Channeling Biz
Biz, if you’re Google Alert or Technorati ping sent you here – I’d love a comment… For the rest of you, Imagine you’re Biz Stone, sitting on top of the Viral Masterpiece that is Twitter. An amazing little application that does so little, but make people pretty damn happy. As we all know, Twitter is having problems – Alex Payne, one of the Twitter Developers, discusses this at length (emphasis mine):

Twitter is the biggest Rails site on the net right now. Running on Rails has forced us to deal with scaling issues – issues that any growing site eventually contends with – far sooner than I think we would on another framework.The common wisdom in the Rails community .. is .. just throw more CPUs at it. The problem is that more instances of Rails … means more requests to your database. At this point in time there’s no facility in Rails to talk to more than one database at a time. <snip> All the convenience methods and syntactical sugar that makes Rails such a pleasure for coders ends up being absolutely punishing, performance-wise. Once you hit a certain threshold of traffic, either you need to strip out all the costly neat stuff that Rails does for you (RJS, ActiveRecord, ActiveSupport, etc.) or move the slow parts of your application out of Rails, or both.It’s also worth mentioning that there shouldn’t be doubt in anybody’s mind at this point that Ruby itself is slow. … Ruby is slow

Ouch. Looks like Twitter is Riding Rails right off a cliff. I’ll tell ya what, If I’m a savvy Web 2.0-funding VC, one of my first questions is going to be something along the lines of "So when are you guys going to get this app off Rails"? I just left Twitter today. It’s annoying. That damn bird and cat screwing off in "ur serverz" is really, really annoying. To tell you the truth, I can’t believe Twitter is even talking about funding right now – I’ll guess one of the conditions of said funding is a move to a new platform. Hmmm.

How Does Campfire Do It?
I just watched a pretty informative interview with DHH at RailsConf in Canada. The interviewer asked some very pointed questions, and one of them is about Campfire, and how they scaled it. DHH was pretty candid (is he ever not? Emphasis mine):

…we started to do stress testing, we started running performance benchmarks and we realized that the initial setup we had was just not fast enough. Step one was adding caching in Rails. We were generating a lot of JavaScript dynamically, so we started caching that JavaScript, shoving it in into a database and then serving it out. That made a huge jump and we actually launched on that…in our case we (eventually) did feel the need to make something faster, so we looked at the Campfire application. Where was the bottleneck? Where were we having issues or issues that were going too slow? We found that bottleneck and that bottleneck was a hundred lines of Ruby code. <snip> So we chose to rewrite those hundred lines of Ruby code, to see what it would take to write it in the fastest language we can rewrite it in; we didn’t rewrite it in assember, but we rewrote it in C, a fantastic language for rewriting performance bottlenecks.

Yah I rewrite a lot of stuff in C when I can’t get my app to scale properly… it’s so … cushy. So your choice, when you come down to it, is to "throw more CPUs at it" or "rewrite it in C". There you have it. I wish the answer was something else but I’m guessing that if DHH were here he’d tell me to Fuck Off. In fact I’m sure of that.

What DHH Should Be Saying
The thing that I’m amazed about, as I watch these videos and statements come out of the Rails Core Team, is that they don’t really care about YOUR deployment issues. In the same interview, DHH responded to the scaling question with this:

The hardest part of computer science to ever make general statements about, is performance. I think that there’s nobody who can really answer your performance questions, except for you, in your particular situation, under your particular constraint, on that exact setup that you’re going to use. Tons of people will claim that they can answer your scaling or performance needs and they will try to sell you a software to do that, and I think they are lying

So he’s basically telling you that no one can tell you what to do but you. And if you do then you’re lying to yourself. So tough shit. What he should have said:

The Core Team is committed to helping build a CGI application that will run on any server, and run in a threaded environment to maximize multi-processor servers so that the cost of running Rails can be minimized. I’m still all about me in this whole Rails thing, but now that people are using our stuff (and their businesses are depending on it), I’m beginning to see that I have some responsibility here. I can’t keep telling people to fuck off. We listen to our community.

If you think I’m being a bit hard on the poor guy, you might want to take a look at his blog. He has a charming entry in April entitled "You’re not on a fucking plane (and if you are, it doesn’t matter)!" (there’s that Potty Mouth thing again) in which he decides that offline web apps are "bizzare" and "puzzling". You see I’ve bought in to the whole Rails thing. So much so that I thought the ASP community would benefit from a port. I still believe that, but I’m hoping someone will send a big Hawaiian Moke after me to "Wop my jaw" if I ever act like a Potty Mouth Dane. I can’t even imagine addressing my users this way. I’d really love to see this platform grow away from what makes Mr. Happy feel good.

"Ice Ahead!!" – or Why I’m NOT Picking On Rails
Some people might be thinking that I’m not being fair to a platform that I love. The truth is that I’m kind of pissed off as I watch Mr. Potty Mouth take a ground-breaking platform and "Rick James" it into narcissistic mess on the floor. This could be the thing that pricks The Bubble. Consider that Rails is the Love Child of Web 2.0 and Disillusioned Web 1.0 Developers, whole shops and corporate departments are adopting Rails as a way to push their applications into production more rapidly – what happens when they try to scale these apps and get "Twitter’d"? People get fired and turn sour as years of their lives are wasted by a platform helmed by Prince Potty Mouth. The owner of the Jazz Music site CD Baby (Derek Sivers) had this to say about Ruby just two years ago:

Like a lost soul walkin’ the earth, lookin’ for spirituality, that stumbles upon the right church with the right people at the right time, I’ve found my niche with Ruby. Its little itty-bitty community attracts some brilliant “think different” types with a love for beautiful code that do this for love, not money.

Fast-forward two years (what you and I call today):

Two years later, after various setbacks, we were less than halfway done. The entire music distribution world had changed, and we were still working on the same goddamn rewrite. I said fuckit, and we abandoned the Rails rewrite. I didn’t abandon the rewrite IDEA, though. I just asked myself one important question: “Is there anything Rails can do, that PHP CAN’T do?” The answer is no. I threw away 2 years of Rails code, and opened a new empty Subversion respository. Then in a mere TWO MONTHS, by myself, not even telling anyone I was doing this, using nothing but vi, and no frameworks, I rewrote CD Baby from scratch in PHP. Done! Launched! And it works amazingly well.

This guy was lucky. He’s the boss. I reiterate: The Rails Team needs to accept that they are now a VENDOR, not radical mavericks.

Oh Look! Successful Are We?
Which brings me to my closing point: It’s easy to be the punk upstart. It’s harder to be successful. That’s what this is all about isn’t it? The Rails guys are really, really successful because they created a Bitchen Platform. Unfortunately it seems like they’re not going to be responsible for it. Microsoft gets this part right (most of the time) – they understand (mostly) the weight of doing good stuff, and it comes down to the Uncle Ben Principle:

With great power comes great responsibility

People love to bitch about patents, legalese, lawyers, copyright, etc. but when it comes down to it – when you make something, just like a child, you have to go to great lengths to foster it, protect it, and grow it properly. I won’t claim that Microsoft is the Poster Child here, but look at what’s coming soon: the MVC Framework, the .NET Source available for debugging, Open Source big noses brought in to work the ASP platform, giving the codecs to the Moonlight project… they are getting it, and they are listening. The last thing you do is to tell it to Fuck Off.