Monday, May 2, 2011

The difference between Scalability, Performance, Efficiency, and Concurrency explained

I thought I'd give some explanation of the difference between scalability, performance, Efficiency, and concurrency. To make things more accessible (and because I'm watching a cooking show on TV) I'm going to use a baking metaphor to help explain the differences. In our case, the system in question is baking cookies for consumers.

Scalability, is how well something responds to adding more resources. If we can double our capacity by doubling the number of resources, we've got linear scalability. In our baking example, if we add more ingredients, we can scale to a larger number of cookies. To contrast with our other metrics, this doesn't actually increase the performance of creating a single cookie (they still take 10 minutes to bake), and the efficiency is the same (we just have more capacity). We also cannot bake more cookies in a fixed time period, but over a larger time period we can produce more cookies.

Performance is how fast something can get done, usually best expressed for a single cycle of a single product. If our baker acquires a machine that reduces the amount of time to do a batch of cookies from 10 minutes to 5 minutes, we've increased our performance (reduced the cycle time). This technique has the advantage of increasing the efficiency, a single baker and all his supplies can actually bake more cookies in a shorter timeframe this configuration. This does NOT, however, increase the concurrency... a single baker with a single oven, even if it can bake the cookie in 5 minutes, can NOT bake double the number of cookie simultaneously. We should pay attention to the fact that scalability and concurrency are distinctly different, but related measures.

Efficiency is how parsimonious the process is with resources. If our baker only requires 1/2 the resources to bake the same quantity of cookies, this is more efficient. This doesn't mean that the baker can bake more cookies in the same amount of time, nor does it mean they will bake faster (usually it means the opposite), and it also doesn't mean that he can double the number of cookies simultaneously.

Concurrency is how much work can get done simultaneously. Adding a new baker and a new kitchen will double our concurrency. Obviously this doesn't impact the performance of creating a single cookie and it is 1/2 as efficient as a single baker. In addition, because we didn't actually double the ingredients, we cannot scale to create any more cookies overall.

An interesting problem with these qualities is that they often strongly influence each other (both positively and negatively). Many solutions that increase concurrency ALSO increase scalability. Worse yet, many solutions that increase scalability decrease performance and surprising to many, may also decrease concurrency.


Nadi said...

Thanks a lot, that was really useful :)

Omar Sababha said...

Thank You, saved me lots of search. God Bless You,