Thursday 24th June 2010 | Posted in Software & Applications, Web Dev | No Comments »

When I first started using it to write web apps a couple of years ago, Sinatra supported code reloading in development mode. That feature was dropped from the core of Sinatra at some point and we just got used to restarting the app every time we made a change whilst developing, it’s not that huge an overhead, especially considering Sinatra’s fast start up.
I recently had to work on a Rails codebase for a while, which reminded me that code reloading without restarting in dev mode is functionality I don’t mind spoiling myself with....
Read More »
Tuesday 22nd December 2009 | Posted in Web Dev | No Comments »

I’ve recently had a chance to look at a high availability system designed and built by Forward colleagues Andy Kent and Paul Ingles. It is a critical web service with a very high impact of failure. Essentially, it must stay up at all times.
The service is hosted on Amazon EC2. It makes use of EC2’s geographically distributed regions and different availability zones within each region, fronted by AWS Elastic Load Balancing...
Read More »
Tuesday 10th November 2009 | Posted in Web Dev | No Comments »

Part of my work these days has to do with building and deploying numerous experimental applications with varying life cycles. Many of these applications get built and put on a server in less than a day only to be shut down and never looked at again a couple of days later, others get turned off and revisited after some time, while others graduate to larger, wider scope systems.
This means that I get to deploy applications for the first time more frequently than usual. Also, because we deploy to virtualised infrastructures (including an internal cloud, Slicehost and Amazon EC2), slice instances...
Read More »
Saturday 29th August 2009 | Posted in Web Dev | No Comments »

I’ve often heard people I know and respect say that git is leaps and bounds better than Subversion. I’ve been a relatively early adopter of git, it’s been my VCS of choice for almost two years now. Even though I find it superior to most of the competition I struggle to justify the “leaps and bounds” claim and would rather more modestly call it “a step forward”.
This is probably due to the practices we find benefit our development process. Git puts great emphasis on branching, something we generally tend to avoid...
Read More »
Saturday 15th August 2009 | Posted in Web Dev | No Comments »

Several times over the past few months I made short lived attempts of delving into the mechanics of nginx modules. Although an invaluable resource to anyone seriously interested in the subject, Emiller’s Guide To Nginx Module Development doesn’t at the time of this writing include a quick-start example I could hack together and see in action. Getting something to run as quickly as possible is my preferred way of starting the study of new things and every time I caught myself searching the web for a “Hello world nginx module”.
I will...
Read More »
Thursday 6th August 2009 | Posted in Web Dev | No Comments »

Applying a clear distinction between stateless and stateful content when designing a web application is tricky but worth tackling early so that content not specific to user sessions can benefit from web caching. The technique we are trying out for scramble.com reminds me of what I described in State separation and was introduced to me by Mike Jones who was inspired by the Dynamically Update Cached Pages chapter in Advanced Rails Recipes.
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

A few months ago I wrote about a possible method for centrally configuring HTTP cache headers in Rack based web applications which I called Rack::CacheHeaders. This is useful if your application’s architecture involves tools like Squid or Varnish, or if you are generally interested in harvesting the numerous advantages of HTTP caching for your web application.
The code has evolved a bit since and proven useful in a number of production systems. I...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

A few months ago I wrote one of the axioms for a community effort called 97 Things Every Software Architect Should Know which was driven and edited by Richard Monson-Haefel. This collection of principles, as contributed by an impressive range of software architects around the world, was recently released as a book by O’Reilly Media and is well worth a look if you’re interested...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Consider an application which as part of its functionality queries a product search web service.
WEB_SERVICE_ADDRESS = 'http://www.example.com'
url = URI.parse(WEB_SERVICE_ADDRESS)
Net::HTTP.start(url.host, url.port) do |http|
http.get('/product-search', 'q' => 'guitar')
end
Inspecting the response headers, we notice the web service instructs consumers that the results of the query will remain the same for one hour.
curl -I "http://www.example.com/product-search?q=guitar"
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: max-age=3600, must-revalidate
Content-Length: 32650
Date: Sat, 14 Feb 2009 13:53:31 GMT
Age: 0
Connection: keep-alive
At this point we can choose to ignore the cache control header and keep on querying the service for this specific resource regardless of whether the response is going to be the same. This is...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Distributed key-value stores present an interesting alternative to some of the functionality relational databases are commonly employed for. Advantages include improved performance, easy replication, horizontal scaling and redundancy.
By nature, key value stores offer one way of retrieving data, by some sort of primary key which uniquely identifies each entry. But what about queries that require more elaborate input in order to collect relevant entries? Full text search engines like Sphinx and Lucence do exactly this and when used in conjunction with a database will...
Read More »