Neil Middleton

Doing lots of things - fast

Recently, we’ve been spending a lot of time looking into the corners of the web that a lot of other agencies don’t often get the chance to – that of the high performance web. In essence, I’m talking the concept of doing lots of little things fast. Very fast.

You may not have really seen this stuff out there, but you’ve certainly used it. Google manages over 1 billions searches per day. Twitter processes 200 million new tweets per day. Facebook deals with 30 billion new pieces of content each month.

So, how do these companies deal with this volume? The key lies in processing queues, doing lots of little things fast, which is where we’ve been picking up some experience for some time.

As the current land lies there are a few options available to the budding developer – traditional web programming, specialised job queues built using tools such as Java, Erlang or Scala, or the somewhere-in-between option of frameworks such as Joyents Node.js.

As we’re web developers we like to stick with what we know and focus on the tools that let us use the tools already at our disposal such as Ruby and Javascript, the two languages that every single Kyan developer lives and breathes.

The key with these hybrid frameworks that makes them different to a traditional web framework, such as Rails, is one of architecture in that they are designed to be ‘non-blocking’.

A blocking framework, such as Rails suffers from a performance point of view in that it spends a fair amount of time waiting for other processes to complete. Database queries need running, DNS lookups need to be made, files need to be read – all of which take time, and during this time the process is sat there twiddling its little electronic thumbs. Whilst this makes the application build super simple and stable, it’s not the quickest to run.

So, what about non-blocking options? A few options exist out there already. Tools such as Cramp, Sinatra-Synchrony and the current Web 3.0 (there, we said it) darling Node.js. The key to all of these is that when we need to do something which takes time such as a database query, instead of sitting around waiting for the query to come back, the process will go off an amuse itself doing part of another request, meaning that your throughput and CPU utilisation go through the roof, making more use of the machine at hand and reducing cost.

However, there are drawbacks. Node.js for instance is very new, but maturing at an alarming rate. Due to this the testing and monitoring stories aren’t fully fleshed out, but are getting there fast. With the adoption of some large scale applications from the likes of Github and LinkedIn it’s going to be a strong platform very soon.

At Kyan, we’re Ruby developers at heart, and are well practised with Ruby so this is where we like to keep things at the moment as we know how to test and monitor our Ruby applications better than most, but we’re also sure that it won’t be long before we’re rolling out the next generation of platforms and adding tools such as Node to our core.

Tags: kyan rails javascript webapplications ruby sinatra node performance application

Comments: 2

Piers
commented on

like your factory pic - are they apple components on the table? :-)

Wills Bithrey
commented on

Great post Neil. I've not really had a play with Node.js yet, maybe it's time I did :) !

Add a comment

Note: comments are moderated before publication.

Most Popular

Cooliris and the 3D wall.

Paul Sturgess

Cooliris (formerly known as PicLens) is described by it’s developers as a “lightening fast ‘3D wall’ that lets you browse thousands of images, videos and more with ease.” Cooliris is installed as a browser add-on for Firefox, Safari or Internet Expl…

The Entifyr

Steven Wake

The Entifyr is a small web application that started life as an personal experiment to automate the removal of problem characters from client supplied content (usually Microsoft Word documents). The offending characters are replaced with corresponding entities (hence the name) al…

Kyan.com colophon

Robin Whittleton

Now that our new site is live, I can finally talk about development decisions we made. The site last had a makeover in mid-2008 so what we can do has moved on quite considerably, and we’ve tried to take advantage of that where possible.

Free Wifi in Guildford

Peter Roome

I was asked by a friend today if I could recommend any bars/restaurants/cafés in Guildford where she could access free WiFi on her laptop. Besides Giraffe I wasn’t aware of anywhere else in town so I posted the question to Yammer in the office and received a number of help…