Saturday, May 14, 2011

How to scale your application: Cloud & Cache

From last few days, I have been reading a book about "Web Scalability" and some intresting articles about “scalability”. In a nut shell, how to improve performance and better scale your application. With this post today I’m going to discuss some major choices to dramatically raise the scale of applications:

Scaling option # 1: Add servers to increase capacity. Add servers or virtual machines to cache user Web sessions, execute business logic, and process transactions. Each added server carries the cost of hardware, software, electricity, and ongoing management. Even if you buy more application servers, your database may then become a new bottleneck. Databases can be redesigned to scale up or out, but it is often very costly to do so. The new buzz, Cloud computing can deliver server instances on demand, but it cannot redesign your application code and data to take advantage of additional resources. And soon or latter one will realize and say, “We can’t just keep throwing hardware at the problem.”

Scaling option # 2: Re-architect the application for greater capacity. Redesign the application for greater capacity by sharding databases, going stateless, splitting functions, improving the layering and separation of concerns, and/or adding asynchronous processing, common services, caches at every layer, single-function appliances, etc. or thorowing new pattern to re-factor some or most of code will take lots of time and money. Most organizations find this remedy too slow to deliver results and sometimes too risky and expensive. Your management and more likely users will say “We’ve got a problem now — we can’t wait a year to solve it.”

Scaling option # 3: Add caches that scale easily. Elastic caching platforms add a fast, scalable, and fault-tolerant data-access layer that can be used to cache transaction results, user session objects, shared application data and other data. Most organizations find that elastic caches easily fit into existing Web architectures and improve scale at a lower cost than the first two options. Also since mobile development is on high right now, that area can really get advantage of cachine solution, as they can choose what object, variable to cache or not to cache. Once you use this solution no one will go back to previoud options.

If you didn’t get bored so far and reached here, Congrates!!! And by now it would have been clear to most of you, that I’m going with 3rd option to gain scalability of web applications. Hopefully in coming days will post more about major caching players.


  1. Hi Vikas
    Thats a very good information you shared.I have few doubts regarding my web application deploying on cloud.
    i am looking for two things
    1) Make my web application used my multi-tenants instead of deploy at their premises
    2) I want to increase the sacalability of my application.

    Could you please , how to go furhter and what are the available options .

    Thanks in advance


  2. Hi Jyothi,

    Thanks for your comments.

    1 - You could try Cloud Foundry from Spring Source as from there you can download instance and install in your servers.
    2- In my view you could improve performance & scalability of your app by introducing caching provider (if you dont have one)...thats one idea...

    hope this will help,