Tuesday, April 23, 2013

Scalability


Scalability is nothing but how the entire system performs for number of user, session and transaction. In other word scalability is the capability to increase the resources based on the usage. The key consideration for the scalable application is based on the additional load adding additional resource will not require any application change.

Scalability something you have to think from day one while designing your application.  For example to increase the scalability adding a load balanced server is not meaning full if you designed your application for single system. In other case you designed a high scalable application and deployed in the low configured system will not help. So scalability should require a balance between software and hardware

To increase the scalability of the application we can either follow scale up or Scale out depends upon application architecture

Scale Up
Scale Up means increase the memory / better processor / migrate to powerful system ideally in single system increasing more capacity to perform better.  This approach doesn't require any addition development effort only it required system configuration.

Scale Out
Scale Out means distribute the processing load across multiple servers. The advantage of scale out is we can dedicate the several machine for commonly accessed task, it increases the applications fault tolerant. It required more administrative effort to manage more system, but we can move to cloud servers for better management. This will create a more design effort for example if you not considered location transparency in mind scaling out is not possible.

Good design is required for Scale out.  Few design consideration for better scalability

  •  Identify the transaction which may take longer time to process, and analyze how we make those task make we make it asynchronous.  
  • Use transaction where ever required.  For example inserting values into single tables doesn’t required any transaction because if it failed no need to rollback any other transaction.
  • Open database connection as late as possible and release it as early as possible.
  • Remove all single point bottlenecks while designing your architecture to support scale out.  Example Make your application to be stateless.
  • Identify proper Database Scale out approach while designing you architecture.  ( Mater – Slave replication/  Database Clustering / Database Shading)
  • The architecture should allow horizontal growth to add more servers.
  • When designing a distributed application, logical separation should also be considered
  • While using Dependency Injection/ Reflection/Annotations will have marginal performance issue, so make a careful choice when using these.
  • Leverage Cache feature
  • Using ORM some time may result performance issue, because of non-optimized quires.
Identify Scalability bottlenecks
To identify scalability bottlenecks it important to test and identify the major workloads and mitigate in the early stage. Scalability testing is the extension of performance testing.  Use performance test to arrive a baseline for application performance. Perform scalability testing systematic manner to ensure that all relevant data is collected.  Some of the scalability testing attributes needs to analyze

  • Response Time
  • Throughput
  • Number users
  • CPU memory usage
  • Network Usage
  • Web server

No comments:

Post a Comment