Chris Umbel

Tale of a Website, from Rails to ASP.NET to Django

I hesitate to call it complete yet but for the most part www.chrisumbel.com has been ported from ASP.Net to Django. Sure, there really isn't a lot to this site so no port would have been incredibly painful but I'm quite pleased with the effort level (or lack thereof) required to get it done.

Aside from just this port it's been a long and interesting ride for just a bunch of blog posts and comments.

Ancient History: Rails in my basement

In reality the story began with Ruby on Rails several years back. This site still bares the look, feel, basic data structure and even a few blog posts from kilnaar.com which was based on a Rails and MySQL stack and spent most of its time running on various OpenBSD, Solaris and Linux machines in my basement.

While I was always pleased with kilnaar.com it got to the point that I became sick of hosting it myself. I was lucky to go all those years with no major hardware failures considering most of them were spent on a rickety a old Sun Ultra 10 MySQL box and a PIII Dell PowerEdge 1300 webserver. Ultimately I ended up slapping it in a Linux VM which ran on a MacBook whose screen was actually held together with duct tape.

Enter ASP.Net

In January 2009 I decided it was time to move on and build a bit more of an identity. To that end I bought the domain name chrisumbel.com. While I was in the mood for fresh starts I figured, what the hell, I'll start over with a new codebase and go with plain-old-web-forms-ASP.Net, SQL Server and Entity Framework data access all hosted cheaply on godaddy.

Why the Microsoft stack? I honestly can't answer that. I'm intimately familiar with all the technologies involved considering I was a .Net developer for years and currently hold a post a SQL Server DBA. That made the barrier to entry quite low to be sure. Still I was ending up with virtually the same application that already ran well under rails. I probably could have gotten away with just switching the logo. I guess it was just something to do.

It had been a few years since I've worked with ASP.Net and guess I forgot why I went to rails in the first place. Since I'm not getting paid to do this site, let alone by the hour or keystroke there was no real benefit from me choosing that stack. Even within the confines of the .Net I really should have investigated ASP.Net MVC as that would have likely allowed me to get away with a lot less thinking. I have far more important problems to solve with my time rather than gluing an architecture together.

I changed platforms for all the wrong reasons. I changed mainly for changes sake. There were no good financial or technical reasons.

The godaddy hosting also didn't end up working for me. Even for such a simple site I'm the kind of guy who needs (or at least wants) a bit of control over IIS. I was unable to use my own HttpHandlers and had no control over authentication schemes. For many people, if not most, that would be absolutely fine. I certainly won't badmouth it. It was, however, a thorn in my side. Because of this I ended up going to virtualized hosting which costed a bit more but I was happy to spend the money at that point. I was getting traffic and having enough fun doing it to spend the cash.

Present day: Django

Despite the fun I was having with my site a lot more effort was required to make changes because of my design. I'm not going to start blasting ASP.Net here. While I firmly believe it's a generally less productive platform than Rails or Django most of the problems resulted from my own mistakes in the design process. Perhaps a serious re-architecting or adopting MVC could have saved me but another option, Django, presented itself.

An asset I had from other projects I was working on was a dedicated and somewhat underutilized Linux EC2 instance. Since I had that instance anyway and it had plenty of surplus capacity I decided to abandon ASP.Net altogether. By moving to this instance my hosting essentially became free and I had total control.

To be honest my old rails code could have possibly been adapted to my recent changes but Django, a python based web framework, caught my eye. The way "applications" (which would probably be called something more like components in other frameworks) plug right in together seems to make adopting (and adapting) third party code disarmingly simple.

The template system, which initially turned me off a bit, also ultimately turned out to impress me. At first I wanted something more rails-like with the actual core language powering it. That's quite difficult for Django, however. Due to Python's significant white-space it's nearly impossible to fit it in as a template language without getting hairy.

I certainly warmed up to Django's template language as time went on, though. It's designed with a single purpose, to be a template language. Because it was designed with one purpose in mind all the goodies are there for typical HTML processing tasks. It definitely feels like it was built for the job. The template inheritance also let me get a lot bang for my HTML buck.

Combined with it's data access Django imposes a good design upon you much like rails. It makes it very easy to not make mistakes that lead to maintainability nightmares just by pushing you in the right direction.

Microsoft uses the phrase "fall into the pit of success". In my opinion Django's do-the-right-stuff-in-the-right-place and don't-repeat-yourself (much) architecture delivers on that philosophy a bit better than ASP.Net.

Conclusion

Through all of these iterations this site is still really just a blog engine. If I wanted it to stay that way I'd have just used an existing blog engine. I do, however, ultimately want far more out of this site and I don't want it to be difficult to get there. I believe Django is the key to achieving that goal but only time will tell.

Thu Aug 20 2009 18:08:00 GMT+0000 (UTC)

Follow Chris
RSS Feed
Twitter
Facebook
CodePlex
github
LinkedIn
Google