views:

254

answers:

6

I've heard that people say that they've made a scalable web application..

  1. What really is scaling?

  2. What can be done by developers to make their application scalable?

  3. What are the factors that are looked after by developers during scaling?

  4. Any tips and tricks about scaling web applications with asp.net and sql server...

+1  A: 

Scalable means that your app is prepared for (and capable of handling) future growth. It can handle higher traffic, more activity, etc. Making your site more scalable can entail various things. You may work on storing more in cache, rather than querying the database(s) unnecessarily. It may entail writing better queries, to keep connections to a minimum, and resources freed up.

Resources:

  1. Seattle Conference on Scalability (Video)
  2. Improving .NET Application Performance and Scalability (Video)
  3. Writing Scalable Applications with PHP
  4. Scalability, on Wikipedia
Jonathan Sampson
i don't know, but fixed it :-)
moritz
+3  A: 

My 2c definition of "scalable" is a system whose throughput grows linearly (or at least predictably) with resources. Add a machine and get 2x throughput. Add another machine and get 3x throughput. Or, move from a 2p machine to a 4p machine, and get 2x throughput.

It rarely works linearly, but a well-designed system can approach linear scalability. Add $1 of HW and get 1 unit worth of additional performance.

This is important in web apps because the potential user base is ~1b people.


Contention for resources within the app, when it is subjected to many concurrent requests, is what causes scalability to suffer. The end result of such a system is that no matter how much hardware you use, you cannot get it to deliver more throughput. It "tops out". The HW-cost versus performance curve goes asymptotic.

For example, if there's a single app-wide in-memory structure that needs to be updated for each web transaction or interaction, that structure will become a bottleneck, and will limit scalability of the app. Adding more CPUs or more memory or (maybe) more machines won't help increase throughput - you will still have requests lining up to lock that structure.

Often in a transactional app, the bottleneck is the database, or a particular table in the database.

Cheeso
~ 1 Gpeople + Google (which may account for as many again) :-)
Joey
+2  A: 

What really is scaling?


Scaling means accommodating increases in usage and data volume, and ideally the implementation should be maintainable.

What developers do to make their application scalable?


Use a database, but cache as much as possible while accommodating user experience (possibly in the session).

Any tips and tricks about scaling web applications...


There are lots, but it depends on the implementation. What programming language(s), what database, etc. The question needs to be refined.

OMG Ponies
Your formatting is a bit stunning. However, +1 for a good answer.
gahooa
+19  A: 

What really is scaling?

Scaling is the increasing in capacity and/or usage of your application.

What do developers do to make their application scalable?

Either allow their applications to scale vertically or horizontally.

Horizontal scaling is about doing things in parallel.

Vertical scaling is about doing things faster. This typically means more powerful hardware.

Often when people talk about horizontal scalability the ideal is to have (near-)linear scalability. This means that if one $5k production box can handle 2,000 concurrent users then adding 4 more should handle 10,000 concurrent users. The closer it is to that figure the better.

The ideal for highly scalable apps is to have near-limitless near-linear horizontal scalability such that you can just plug in another box and your capacity increases by an expected amount with little or no diminishing returns.

Ideally redundancy is part of the equation too but that's typically a separate issue.

The poster child for this kind of scalability is, of course, Google.

What are the factors that are looked after by developers during scaling?

  • How much scale should be planned for? There's no point spending time and money on a problem you'll never have;
  • Is it possible and/or economical to scale vertically? This is the preferred option as it is typically much, much cheaper (in the short term);
  • Is it worth the (often significant) cost to enable your application to scale horizontally? Distributed/multithreaded apps are significantly more difficult and expensive to write.

Any tips and tricks about scaling web applications...

Yes:

  1. Don't worry about problems you'll never have;
  2. Don't worry much about problems you're unlikely to have. Chances are things will have changed long before you have them;
  3. Don't be afraid to throw away code and start again. Having automated tests makes this far easier; and
  4. Think in terms of developer time being expensive.

(4) is a key point. You might have a poorly written app that will require $20,000 of hardware to essentially fix. Nowadays $20,000 buys a lot of power (64+GB of RAM, 4 quad core CPUs, etc), probably more than 99% of people will ever need. Is it cheaper just to do that or spend 6 months rewriting and debugging a new app to make it faster?

It's easily the first option.

So I'll add another item to my list: be pragmatic.

cletus
I second your last few points, about only worrying about scaling when you have to. > 95% of web sites/applications won't have any scaling problems that can't be solved easily and cheaply with a better server. When the big problems rear their ugly heads, then you can start worrying. You are not Twitter: you will not have a million people suddenly knocking on your door.
Clueless
+1 Awesome answer
Doug Neiner
+1  A: 

Books have been written on this topic. An excellent one which targets internet applications but describes principles and practices that can be applied in any development effort is Scalable Internet Architectures

ennuikiller
+1  A: 
Square Rig Master