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 »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

It is usual for web applications to deal with serving content specific to a user’s session. This makes web caching harder to implement as we don’t want content that is meant to be viewed by a particular user being cached and accidentally offered to others. Some HTTP accelerators like Varnish choose to by default completely ignore responses that contain cookies. However, not all content is always tied to a user’s session, and if that content doesn’t change in real time, it makes sense to cache the parts that are common to all users in order to...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Many applications comprise of a number of components, the majority of which are shared by others in the system. Different parts of the system exercise their collaborators in a variety of ways, think of a website where data is periodically processed by jobs and stored in a database while presentation modules handle rendering the data in ways meaningful to end users. Shared resources can yield the unwanted side effect of performance degradation when a given component is being pushed too hard to perform part of its tasks, affecting each piece of the system that depends on it. In the shared...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Code-on-demand on the web is commonly encountered in the form of JavaScript or applets. As we examine the web as a platform for services spanning beyond the typical server/browser interaction, it’d be interesting to further explore the code-on-demand constraint from a service integration perspective.
One of the advantages of offering executable code alongside a service’s data is client simplification by code reuse. For example, we can distribute a library that’s specific to the data on offer, so interested clients can make use of that functionality and avoid having to re-implement it. Another...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Rack is an interface between web servers and Ruby web frameworks. The HTTP protocol, amongst other things, defines requirements on HTTP caches in terms of header fields that control cache behavior. The purpose of this article is to demonstrate a possible implementation of a piece of Rack Middleware which enables web application developers to configure a web application’s resource cache related headers in a non obtrusive, centralized manner.
Rack supports the notion of Middleware, pieces of code that sit between the HTTP request and response life...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

The use of an HTTP accelerator such as Varnish or Squid in reverse proxy/accelerator mode can drastically improve a web application’s content delivery capabilities. Successfully implementing caching comes with numerous challenges but the fundamental goal is straightforward: A stack’s dynamic content generating layer should ideally not have to generate the same content more than once.
require "rubygems"
require "sinatra"
def guitars
@@guitars ||= ['Les Paul', 'SG']
end
get "/guitars" do
guitars * ', '
end
This application exposes a /guitars resource, a request for which will always hit the application server if no caching has...
Read More »
Monday 8th June 2009 | Posted in Web Dev | No Comments »

Performing computations in parallel is a popular technique for improving application performance and can be achieved in a number of ways, most commonly by employing threads or by splitting workload in a number of concurrent processes.
Memory usage is often a headache with large dataset computations. While memory optimization is something to be sought after, tracking down memory leaks can become tedious and time consuming. We can decrease the chances of a heavy job running a system’s memory dry by coming up with a strategy for fragmenting the job into a number of shorter running processes. By doing so, any memory...
Read More »
Wednesday 1st April 2009 | Posted in Microsoft, Security, Web, Web Tech | No Comments »
A selection of removal tools that may help you clean a Conficker Virus infection. The Virus activated itself on 1st April 2009.
Conficker D latest variant - Infections started 2009-03-04
Symptoms
Blocks DNS lookups
Disables AutoUpdate
Kills anti-malware
Download cleanup tools
One, Two, Three, Four, Five
"Conficker, also known as Downup, Downadup and Kido, is a computer worm that surfaced in October 2008 and targets the Microsoft Windows operating system. The worm exploits a previously patched vulnerability in the Windows Server service used by Windows 2000, Windows XP, Windows Vista, Windows Server 2003, Windows Server 2008, Windows 7 Beta, and Windows Server 2008...
Read More »