September 01, 2005

Can you do big applications in little languages?

Follow-up to Ruby vs Java from Secret Plans and Clever Tricks

In a comment on my previous post, Jon said

My overall impression of Ruby on Rails is that it might be good for getting things going quickly, but it's bad for building large, stable, maintainable systems

I think this is interesting enough to examine in more detail. Though before I start, I'd better add a disclaimer: I'm a Java programmer, and whatever I might say in the rest of this entry, I'm likely to remain one for the forseeable (I hope!)

Anyway, on with the show. I think you can take two approaches to the statement above. Approach 1 is the easy one: Sure, you wouldn't write an airline reservation system in RoR, any more than you'd use J2EE to munge the output of top, but how large is large? Does any UK university have a bespoke web system which is too big to manage in RoR ? Sometimes, Java programmers can be guilty of treating every application as if it was the flight control system for a 747, when it's really just CRUD for 3 database tables.

…which leads me to approach 2, the more interesting approach. What are the limiting factors for an app. written in RoR? Or PHP+{Cake/Biscuit/Mojavi/etc.}, since it shares many of the same characteristics ?

I think that scalability in terms of performance is a complete red herring. There are any number of mahooosive apps running on LAMP architectures – tens or hundreds of millions of hits a day. There are less for Rails, in part because it's much newer technology, but I don't see anything there that makes me think it wouldn't scale in the same way.

Similarly stability, at least in terms of uptime. PHP and Rails' shared-nothing, sessionless architectures actually (ISTM) make it easier to provide resilience in the form of load-balanced servers, and the periodic cycling of httpd workers makes worries about memory leaks and the like much less of a big deal. Again, looking at the real world there are loads of LAMP sites whose application uptime is up above 99.99%; I'd contend that there are very few web applications with an uptime requirement that couldn't be met with a scripting langage-based architecture.

So we're left with questions of maintainability, which is where it gets interesting. There's absolutely no doubt in my mind that there are some awful bits of PHP out there running stuff on the internet. Not least because I've seen and had to clear up some of it. But there's some bloody terrible java too. And when you consider Ruby, the picture gets even muddier; Ruby is at least as OO as Java, if not more. There's nothing inherehent in Ruby that's any more likely to make you write crap than there is in Java.

At the end of the day, maintainability is, ISTM, a people issue and not a language issue. And this may be one area where Java scores. Because the barrier to entry for java apps is higher, (a) the average coding skill level is higher, and (b) the average team size (and thereby probability of at least one good coder involved in the project) is higher. But that just suggests that the same team ought to be able to produce equally maintainable code, regardless of platform – so they should choose whichever one makes the job easier.

There are a few thing that do weigh heavily in Java's favour though. Decent tooling (IDES, build tools, etc) and, arguably more importantly, high quality libraries for core stuff like socket malarkey, threading, unicode handling and XML parsing.

Nontheless, I'm skeptical of the claim that a scripting langage "can't do" big complicated applications. It feels a little bit like something that (to paraphrase Cal Henderson) "Is said to be true because it would be good if it was true".

Still, I'm sticking with Java. It's like a favourite jumper; sure it might be a bit scratchy, and some of those new t-shirts the cool kids are wearing sure look good, but I can't quite bring myself to risk getting caught out in the cold :-)


- 6 comments by 3 or more people Not publicly viewable

[Skip to the latest comment]
  1. John Dale

    So we can probably conclude, I guess, that you don't think we should switch our entire development process over to Ruby. (Not a huge surprise, I guess.)

    But might there be some sorts of apps which we might one day develop for which Ruby/Rails would be sufficiently attractive to consider, even allowing for the cost of taking up a different language? If we were doing WebDB right now, for example, would Ruby/Rails be at all tempting for that (or something like it)?

    01 Sep 2005, 20:45

  2. Chris May

    There might. The problems I see right now are that

    (a) RoR is rather 'young', and might turn out to be a flash in the pan in 12 months time though that wouldn't be a problem for an app with a short shelf-life like the CG booking system

    (b) Is it a better investment to have team members know half as much about 2 platforms, or twice as much about one? I note that Flickr have Java guys and PHP guys, but no Java and PHP guys. It might be unfortunate to end up in that situation (though I'm not 100% sure)

    01 Sep 2005, 21:03

  3. The other problem might be that you might struggle to get people to try Ruby as one of the downsides is that it is not particularly commercial right now. If you started asking people to get into Ruby…would they want to? Lots of people I'm sure enjoy experimenting, but it is different to commit work time to an unknown quantity.

    02 Sep 2005, 00:47

  4. When I wrote "bad for", maintainability is exactly what I had in mind, since it's more important for larger apps.

    I don't agree that maintainability is purely a personnel issue. Language features, tools, components and community all play a role as well.

    (Also I think it's a myth that there are lots of massive LAMP apps – there are vast numbers of small ones, but very few truly massive ones. Which isn't to say I'm anti-LAMP, having chosen it for University projects before now.)

    02 Sep 2005, 12:07

  5. Chris May

    How massive did you want? There are very few truly massive apps that one can find out about easily regardless of architecture, but here's a handful of LAMP ones:

    – Wikipedia runs LAMP on 83 servers distributed between the US and Europe.

    – Flickr have about 120 boxes running LAMP for a million users and several TB of data

    – Yahoo have a cluster of tens of thousands of boxes running LAMP.

    … and that's just the results of 10 minutes on google. I don't know the details of the Yahoo setup, but it seems to me that that's about as big a system as you could reasonably expect to encounter – other than google and amazon there probably aren't any bigger.

    02 Sep 2005, 15:43

  6. The other big one that I know of is Slashdot. I don't think four counts as lots.

    06 Sep 2005, 09:30


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Most recent entries

Loading…

Search this blog

on twitter...


    Tags

    Not signed in
    Sign in

    Powered by BlogBuilder
    © MMXXI