Saturday, December 24, 2011

Scalability of Modern web applications

In my opinion there are two types of applications as for as number of user is concerned.
1) Desktop applications which supports single user (Ex: MS Word)
2) Server side applications which supports multiple users (Ex: Web application)
Designing a Desktop applications is easy compared with server side apps which demands massive scalability. Hence the hardware requirements are entirely different, from single server deployment model to dynamically scalable cloud systems. The non-functional requirements take high priority and most challenging in server side applications.

Scalability is one of the most important aspect of the today’s modern web application. The software architecture is a key factor in determining scalability of the system, the second one is coding, and finally tuning the hardware. Below I have described typical hardware architecture of the modern web apps.

External Caching servers: This sits in front of the web servers to serve static contents such as images, xml, css, html, and other static files. First time request always routed to web server cluster but subsequent requests are handled by caching servers. These servers store the above static contents/files for faster response to users.  It also been used as security boundary form some types of thread. Say denial of service defence. Typically these servers require lot of RAM, moderate CPU, high speed network and moderate disk space.

The web server: This sits next to external caching servers, Apache, IIS are two prominently used servers. It serves static content for first time, generates dynamic content (ASP.NET/PHP), Dispatch request to applications servers. This tier also logs errors, warnings, information, tracking users etc. These servers require lots of memory (number of users is mainly depends on this), low/medium disk speed, low disk space is ok. Depends on application, it generates dynamic content, hence CPU requirement is depends on the dynamic content generation.

Application servers: This sits next to web servers. Typically executing business logic, to hold search index, call web services and get data from external services.  Fastest CPU, lot of RAM, Medium speed disk is required.

Internal Cache servers are optional component but in recent years its becoming popular due to high response time the user need. The application or web server requests the internal cache servers for Data/objects.  Memcache is becoming a very popular form of Internal Cache.  These require lots of memory, low disk speed/space, low speed CPUs are ok.

Finally the DB Server holds the Data. Usually it requires high speed disks, medium to high speed CPU’s and RAM. The requirements are highly depends on the application. In recent years few new systems have been designed to provide good horizontal scalability database operations distributed over many servers.  In contrast, traditional DB products have comparatively little or no ability to scale horizontally on these applications. I have discussed about NoSQL previously.

No comments: