Thursday, March 29, 2007

Great Article on Load Balancing

Willy Tarreau, the author of HAProxy, has posted a terrific article on Making Applications Scalable with Load Balancing. If I ever build a site needing to serve more than a few hundred thousand sessions per day, I'll be sure to re-read the article.

Wednesday, March 28, 2007

ClearCase Considered Harmful

I'm a big fan of Configuration Management, and I am a long-time user of CVS and short-time user of Subversion. My current project uses ClearCase, which is often considered to be the leading product in the industry. Initially, I was very excited to use ClearCase, because it is [supposedly] designed with the software development process in mind -- especially when using the Unified Configuration Management model. This is in contrast to CVS and Subversion which does not force users to work in any particular way; note that this is often cited as a deficiency of CVS / Subversion.

First the good, ClearCase :
  • is very good at merging changes or at least, I think it is -- I was warned off branches (activities in UCM ClearCase)
  • can show you, continuously, what the combination of arbitrary streams of development would look like (say, a development branch and a release branch)
Now the bad, ClearCase:
  • sometimes decides not to write changes to certain files to disk, so even though changes are hitting the filesystem in some files, they aren't in others. i.e., your editor sees one thing, your compiler and unit tests another. Get set to reboot and rewrite!
  • will not let you make any change to any file that is not checked out; this doesn't sound too bad at first, but think about how many times you just want to crack open a file and put a couple of print statements in it to figure out if you need to change it. This also inhibits refactoring.
  • is slow to perform common operations (checkout, refresh) and fast to perform uncommon ones (baseline, graph history)
  • has many separate user interfaces for no particular reason, as far as I can tell. There's no equivalent of WinCVS or TortoiseSVN. Note, I'd probably rather be using the command-line interface (cleartool), anyway, but I am having such a difficult time grasping it (see next point) that I'm afraid to try it. In particular, the UI presented by the IBM Rational Software Development Platform, which is based on Eclipse, is abysmal. I actually find the ClearCase plugin for NetBeans far more usable, which is pretty amazing considering that the Rational SDP is a product sold / bundled by IBM and the NetBeans plugin isn't.
  • causes everyone around to disavow any knowledge of it -- maybe some people do know it and just don't want to share because they're busy, but I doubt it. Nobody seems to get ClearCase and all mumble about using something easier.
In the end, I think ClearCase is too sophisticated for its own good, even when using the simplified UCM model, especially for small teams. It's clear to me that I'm probably not going to get much better at ClearCase without some training by an experienced user. I've already got one of the best books available for ClearCase and it's not helping.

I think I might just set up a Subversion repository, do all my work there, and check it into ClearCase when I'm done. I'd probably have a net time savings after the first 3 days of use.

Saturday, March 17, 2007

Essential Browser Plugins for Web Developers

I'm developing a web application that makes significant use of AJAX to improve usability. Inspection of the live DOM and JavaScript is the easiest way to debug the code. In Firefox, there is great plugin support for this:

  • HTML Tidy - validates HTML against the referenced DocType; I treat this as sort of a "compile" check
  • Web Developer - supports live DOM inspection, live CSS editing, resizing the window to particular resolutions, cookie and cache management, and much more
  • Firebug - live inspection and debugging of JavaScript, CSS, and DOM
I also found a really nice plugin this week for Internet Explorer, the Internet Explorer Developer Toolbar. This plugin does most of what the Web Developer plugin for Firefox does, except for the live CSS editing.

Being able to "find element by click" makes working in both browsers much easier. I am still looking for a JavaScript inspector / debugger for IE. Unfortunately, the current code's HTML and JavaScript is tied to IE in certain places because I haven't had the chance to add id elements and such so I can't just do the debugging in Firefox. I will probably integrate MochiKit so I don't alert myself to death.