views:

72

answers:

3

How can one achieve scalable code. Better to frame the question as "What do you mean by scalability of code" and how to determine the extent to which code is scalable.

Waiting for positive replies.

Thanks in advance

A: 

In the ideal case, if you have a computer which runs twice as fast, your program should run twice as fast. Many don't, because the application has to wait for certain other hardware components. You should algorithms with low complexity classes and you should not wait on hardware. Use asyncronous operation if necessary. There are lots of other things to consider.

codymanix
A: 

I understand Scalability as the ability of an application to handle loads greater than its average load and still be able to maintain the required level of performance.

Performance testing specifically Load Testing would be the way to test the scalability of your application.

How to make the code scalable : There is no silver bullet here. Coding best practices to ensure optimal code, Design best practices for scalability (Patterns like 3 tier / N tier help improve scalability as they make it easier to out instead of just scaling up)

InSane
This is a common misconception; the term for the behaviour you're discussing is "stability under load". Scalability more typically refers to the ability to compensate for increased load by introducing increased hardware capacity. Software must be constructed using specific techniques to ensure that extra hardware can be utilized effectively in dealing with extra load.
Mike Burton
Scalability means that the load -- and size of dataset -- your application can handle grows linearly with the hardware resources available to it. If your application can manage a 10 gig dataset on one server, and a 100 gig dataset on 10 servers, it's scalable.
Frank Farmer
@Mike - Hmmmn....i am still unable to grasp though how " stability under load" is different from scalability. To maintain stability under load, we usually have 2 options i.e Scale up or Scale out. Otherwise the stability under load will be compromised due to the inability to scale. Isnt it? Might be a nuance but i dont think i am able to grasp the difference you are trying to indicate
InSane
@In Sane - Stability under load has almost nothing to do with scalability as it is typically defined; it has instead to do with how your application handles resource scarcity, long response delays, and all the other symptoms of high demand. A scalable application, on the other hand, should be supported by infrastructure so as to seldom or never experience those symptoms to begin with. It is useful to have some of each characteristic, but if you want to be a true giant in service provision stability under load simply will not get you there while scalability will.
Mike Burton
@Mike - Thanks for the explanation. I seem to have been under a misconception. Do you have any reliable link / reference where I learn more about these and other related factors?
InSane
@In Sane - Patterns of Enterprise Application Architecture is a pretty solid overview of design and architectural issues and design-level solutions to those issues. You can find excerpts of the book via Google books - search on Scalability patterns enterprise and you'll get to the area where he talks about performance characteristics of large systems.
Mike Burton
@Mike - Thats the Martin Fowler book - if i am not mistaken!! Been on the reading list for a while. I better get cracking on it then! :-) Thanks!
InSane
A: 

I like to think of 'Scalability' beyond the most common definitions of load and performance, but a more general idea of a scalable application design.

If you're developing an interface, for instance, and the specs assure you that you'll only have 20 of these or 50 of those, I like to have my developers consider what happens if there are 200 of those, or 5000 of these. How do the interfaces, workflow, processes break down when you increase various elements by an order of magnitude or 4.

Edward M Smith