Sequel Pro URL Shortening

Considering that there are more URL shortening services than anyone cares to (or can) keep track off, there's not exactly the need for another, when you realise the only thing different would be the name. Despite this, I am creating a new URL shortening service, but one that is specific to the Sequel Pro project and not available for general URL shortening use. That is, the service doesn't allow you to create custom short URLs, but is effectively based on the data of the various sites that make up the project.

While messing about with Google Chrome the other day I came across the 'About Memory' page (accessible via the 'Stats for nerds' link on the Task Manager or by typing 'about:memory' in the address bar) which obviously displays the application's memory as a summary, but also split by process, which in Chrome's case, is a process per tab. Aside from the interesting (if it can even be called that) memory usage stats was a warning of a bug that was causing Chrome to seriously over count it's own memory usage, with a link to the actual bug in their issue tracker. Half expecting the link to point directly to Chromium's issue tracker on Google Code, it actually pointed to crbug.com. Ok, so it doesn't take a genius to work out that they're using there own URL shortener to obviously provide short and memorable links when referring to issues, but I actually thought it was a pretty cool idea.

So aside from the obvious benefit of allowing anyone to refer to issues (bugs and enhancement requests) without having to remember the somewhat longer Google Code issue page URL, it also provides some form of insurance to links referring to issues from all over the web using the service will still work in the event that the project decides to change it's issue tracker (either the software or to entirely different domain). Seeing the benefit of this, I thought we could also implement the same sort of service for the Sequel Pro project using the appropriately named spbug.com.

The aim of the project behind Sequel Pro has always been to create the best MySQL database management app for Mac OS X and since joining as a developer in November 2008 every release has brought us closer to this goal. The release candidate for version 0.9.8 has just been made available and depending on feedback should be officially released within the next week or so. As we get close to the much-anticipated version 1.0 release we are now trying to create a solid development infrastructure to support the project. For example, included in the 0.9.8 release will be an integrated crash/exception reporter framework as well as a supporting website to view and manage the submitted logs at log.sequelpro.com. The aim of the added functionality and website is to enable us to improve the overall stability of Sequel Pro, by examining the feedback provided by users (especially for nightly builds). As well as the new log site, is the addition of a new site dedicated to the localisation of Sequel Pro into languages other than English at translate.sequelpro.com.

So where does the creation of a URL shortening service come in? Well, we now have multiple sites supporting the development of Sequel Pro, from version control, issue tracking, crash log management, nightly builds and localisation and so the creation of spbug.com allows us to easily refer to most of these during development (especially on IRC) and when responding to user requests and feedback via email.

Currently the service provides seven different redirects, including the default, which is the site itself redirecting to our issue tracker. Provided with the correct parameters the others redirect to:

The most basic is when referring to a specific issue, for example, spbug.com/530, which redirects to the following issue on Google Code:

http://code.google.com/p/sequel-pro/issues/detail?id=530

To find out how to use the others, I put together a short help page at spbug.com/h, which details there use as well as some other functionality.

The service was originally implemented as single .htacess file with all redirecting done using mod_rewrite, but I wanted something a bit more flexible in terms of being able to update the URLs for which redirects point to as well as to enable some form of logging. The rewritten version is therefore a very simple PHP app, with all the URL redirect (and page rewrite) rules stored in a MySQL database. Redirect logging in terms of the requested URL and where it was redirect to can also be enabled and stored in the database.

The source for the service is also freely available under version 3 of the GPL.

Posted April 5th, 2010