What is scalability ?

When asked what they mean by scalability, a lot of people talk about improving performance, about implementing HA, or even talk about a particular technology or protocol. Unfortunately, scalability is none of that. Don't get me wrong. You still need to know all about speed, performance, HA technology, application platform, network, etc. But that is not the definition of scalability.

Scalability, simply, is about doing what you do in a bigger way. Scaling a web application is all about allowing more people to use your application. If you can't figure out how to improve performance while scaling out, its okay. And as long as you can scale to handle larger number of users its ok to have multiple single points of failures as well.

There are two key primary ways of scaling web applications which is in practice today.

  • "Vertical Scalability" - Adding resource within the same logical unit to increase capacity. An example of this would be to add CPUs to an existing server, or expanding storage by adding hard drive on an existing RAID/SAN storage.

  • "Horizontal Scalability" - Adding multiple logical units of resources and making them work as a single unit. Most clustering solutions, distributed file systems, load-balancers help you with horizontal scalability.


Every component, whether its processors, servers, storage drives or load-balancers have some kind of management/operational overhead. When you try to scale that, its important to understand what percentage of the resource is actually usable. This measurement is called "scalability factor". If you loose 5% of a processor power every time you add a CPU to your system, then your "scalability factor" is 0.95. A scalability factor of 0.9 means you will only be able to use 90% of the resource.

Scalability can be further sub-classified based on the "scalability factor".

  • If the scalability factor stays constant as you scale. This is called "linear scalability".

  • But chances are that some components may not scale as well as others. A scalability factor below 1.0 is called "sub-linear scalability".

  • Though rare, its possible to get better performance (scalability factor) just by adding more components (i/o across multiple disk spindles in a RAID gets better with more spindles). This is called "supra-linear scalability".

  • If the application is not designed for scalability, its possible that things can actually get worse as it scales. This is called "negative scalability".


If you need scalability, urgently, going vertical is probably going to be the easiest (provided you have the bank balance to go with it). In most cases, without a line of code change, you might be able to drop in your application on a super-expensive 64 CPU server from Sun or HP and storage from EMC, Hitachi or Netapp and everything will be fine. For a while at least. Unfortunately Vertical scaling, gets more and more expensive as you grow.

Horizontal scalability, on the other hand doesn't require you to buy more and more expensive servers. Its meant to be scaled using commodity storage and server solutions. But Horizontal scalability isn't cheap either. The application has to be built ground up to run on multiple servers as a single application. Two interesting problems which most application in a horizontally scalable world have to worry about are "Split brain" and "hardware failure".

While infinite horizontal linear scalability is difficult to achieve, infinite vertical scalability is impossible. If you are building capacity for a pre-determined number of users, it might be wise to investigate vertical scalability. But if you are building a web application which could be used by millions, going vertical could be an expensive mistake.

But scalability is not just about CPU (processing power). For a successful scalable web application, all layers have to scale in equally. Which includes the storage layer(Clustered file systems, s3,etc), the database layer (partitioning,federation), application layer(memcached,scaleout,terracota,tomcat clustering,etc), the web layer, loadbalancer , firewall, etc. For example if you don't have a way to implement multiple load balancers to handle your future web traffic load, it doesn't really matter how much money and effort you put into horizontal scalability of the web layer. Your traffic will be limited to only what your load balancer can push.

Choosing the right kind of scalability depends on how much you want to scale and spend. In fact if someone says there is a "one size fits all" solution, don't believe them. And if someone starts a "scalability" discussion in the next party you attend, please do ask them what they mean by scalability first.

References

  1. Cost and Scalability

  2. My linear scalability is bigger than yours

Comments

Kent Langley said…
Very nice article. I hadn't seen ScaleOut Software's products. Those might definitely come in handy for a project I have going on right now. Thanks!
Alit Bar-Sadeh said…
I agree with Kent. This is a great post and is, in fact, along the lines of how I believe scalability should be defined. You might be interested to read a related white paper that my CTO, Nati Shalom, wrote recently; it's called "The Scalability Revolution:From Dead End to Open Road" and can be found at http://www.gigaspaces.com/os_papers.html#scalrev.

In the paper, Nati defines scalability as "the ability to grow an application to meet growing demand, without changing the code, and without sacrificing the data affinity and service levels demanded by your users."

So when you ask âہ“is my application scalable?â€Â youâۉ„¢re asking whether your application, as it is today, can meet growing demand without breaking, and without sacrificing service levels, as demanded by your users.

Another resource about this topic that you might find worthwhile viewing is a video recording of a session from SpringOne07 called "Scalable as Google, Simple as Spring"; see http://www.parleys.com/display/PARLEYS/Scalable+as+Google+Simple+as+Spring
Alit Bar-Sadeh said…
Hi Again, I just realized that the link to the white paper requires registration, so sorry and here is a link that does NOT require registration :) http://www.gigaspaces.com/wiki/download/attachments/19202284/FromDeadEndToOpenRoad.pdf?version=1
Alit Bar-Sadeh said…
Just realized that the white paper link from my previous post requires registration, so sorry and here is a link that does not require any registration :) http://www.gigaspaces.com/wiki/download/attachments/19202284/FromDeadEndToOpenRoad.pdf?version=1
[...] database (seems to be the problem so much of the time, doesn’t it?), and the architecture is inherently not scalable.  Translation:  they want a lot of time to make things faster, time you don’t have.  What [...]
Jeryl Cook said…
Terrocotta allows to scale so easy a caveman can do it.
[...] What is scalability ? - Scalability, simply, is about doing what you do in a bigger way. Scaling a web application is all about allowing more people to use your application. If you can?t figure out how to improve performance while scaling out, its okay. And as long as you can [...]
Cameron Purdy said…
Thanks for referencing my blog entry :) .. this is a topic that I've been dealing with since we released our Tangosol Coherence software in 2001 (now Oracle Coherence Data Grid).

I just wanted to comment on one thing you said: "For a successful scalable web application, all layers have to scale in equally."

My comment is this: Solving scalability problems is often a process of working around the scalability limits of the parts of the infrastructure that do NOT scale equally. In other words, in the real world, one does not have the ability to choose all of the components, applications, system infrastructure, etc. within an organization, because 99% of it is already there and 50% cannot be replaced even within a ten year window. However, the businesses require applications that can both scale and interoperate with these systems.

Peace,

Cameron.
[...] Scalable web architectures » Blog Archive » What is scalability ? (tags: scalability performance) [...]
Sandeep patil said…
This is a best article that gives me lots of knowledge about scalability
[...] the system. However, adding resources incurs additional overhead, making it difficult to achieve. Royans K Tharakan refers to this as a â€Å“scalability factor”, and uses it to enumerate types of [...]
[...] or implementing High Availability. Royans K Tharakan, in attempting to answer the question “What is scalability?”, says: Scalability, simply, is about doing what you do in a bigger way. Scaling a web [...]
[...] in place of an existing service (lets say apache) which can deliver content in 50 ms, then by my definition the new webserver should continue to serve that content at 50 ms even if the number of requests [...]

Popular posts from this blog

Chrome Frame - How to add command line parameters

Creating your first chrome app on a Chromebook

Brewers CAP Theorem on distributed systems