Main Content:

Posts tagged as 'architecture'

12 Scalabilty: What and why? 1 comment

May 30

There's a large amount of news about Twitter's inability to scale floating around at the moment, and I feel this is an important issue for Rails developers to know about, yet many people do not fully understand what indeed scalability is. I am by no means an expert on scaling, however I have studied it extensively and can provide the theory behind it.

The Problem

100 percent server load.

Web applications are becoming increasingly popular, and with more and more seeing social interaction as a requirement, the amount of data passing through an application has massively multiplied. Many applications now provide web services on the side also, so they are being bombarded with even more from external websites and desktop applications.

A single server can quickly become overloaded, at which point you need to "scale" your application across multiple machines.

The Act of Scaling

Xserve Stack.

The simple answers are offload your database to another server, upgrade your application server, and use a CDN to host your files, this is called scaling vertically. Imagine a visitor to a company is a browser request, and a high-rise building is the server architecture, each floor being a different type of server (web, application, database, file), the visitor will enter the door at the bottom, and leave through the door at the bottom when they've got the result they needed.

What happens when you're maxing out an 8 core application server, database server and file server, each with 128GB of RAM and numerous 15,000rpm SAS hard drives? Then you have to scale horizontally, which going back to our street example means that you're company is housed in 5 (or any number of) different buildings, and a visitor can enter any one.

This is where Twitter, and others come across issues.

More Problems

If you are load balancing using multiple servers, users might enter data on one server, and others on another, before they are fully syncronised, for example, a user could delete a message from their account, then another could reply to that message after it has been deleted, because on their server it is still existent, now that's only a small issue, but you can imagine with more time-critical data this can be a major complication that has to be dealt with carefully.