Skip to content

Friday fun

Published on: September 1, 2006    Categories: Django, Frameworks, Misc

It’s the end of the week and, while I’ve got plenty of things I could write about, I’m sort of tired and burned out. So let’s just look at a couple things that went on this week.

Django performance with foreign keys

There’s been a bit of a to-do the last few days over a supposed performance problem in Django. I have a hard time classifying it as a “bug”, though — the whole thing centers around the fact that, to generate an HTML select box of possible choices for a foreign key relationship, you have to, well, fetch all the possible choices out of your database. If you’ve got 30,000 rows in the table you’re FKing to, that’s probably going to hurt your server.

Granted, people keep running into it, but I would hope that this is something which would be fairly obvious when you think about it — offering a list of 30,000 choices means you have to fetch all 30,000 of them and hold them in memory. That’s why raw_id_admin exists, and part of the reason why limit_choices_to exists.

Language Wars

Joel Spolsky has set the Ruby on Rails world ablaze by looking at language platforms for web development and excluding Ruby and Rails — for now. I don’t normally like to use this word, but DHH’s reaction, and the reactions of most of the Rails fans who commented in Joel’s forum strike me as being, well, knee-jerk.

Joel’s looking at language choices from the position of a business user, most likely in a large company, who may have to bet the company, or at least his job, on the results of those choices. And, frankly, there’s not enough historical track record and evidence right now to make Rails or Django or any of the other new frameworks a safe choice in those terms. He listed “three and a half” platforms, and gave Python the “half”, but I’m almost certain that’s to do with things like Zope which have been around for a long time. Even though they have their failings, they have known failings. The new frameworks are still, well, too new — even though they’re seeing use in lots of places — to have those kinds of well-established, tried-and-tested records.

This isn’t news and shouldn’t be, and it’s why Joel qualified his comments about Ruby and Rails by saying that they’d be able to get on the list in “a year or six”. Big organizations are relentlessly conservative, and it’s going to take a few people consistently beating the pants off them to get them to really open up to the emerging generation of web frameworks.