June 25, 2014

What is different between Web Server and Application Server?

Web Server is designed to serve static content to the web using HTTP/HTTPS protocol. Most Web Servers have plugins to support scripting languages like Perl, PHP, ASP, JSP etc, through which these the Web server can generate dynamic HTTP content.


Where as, an application server serves business logic to application programs through any number of protocols (such as RMI/RPC), possibly including HTTP. The application program can use this business logic just as it would call a method on an object. In most of the cases, this logic is exposed by server through a component API, such as the EJB (Enterprise JavaBean) component model found on Java EE (Java Platform, Enterprise Edition) application servers.

In short a Web Server is a server that serves web pages to users via http. An Application Server hosts the business logic for a system.

The key point is that the web server exposes everything through the http protocol, while the application server is not restricted to it.

An application server thus offers much more services than an web server such as Load Balancing, Connection Pooling, Object Pooling, Transaction Management, Messaging services,Clustering, State(session) Management etc. (NOTE: Now Apache tomcat, which is a web server also provides connection pooling.)

Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of. Additionally App Server have components and features to support Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging services etc.

An application server can run on a web server to execute program logic, the results of which can then be delivered by the web server. e.g Apache and Tomcat server.

Web Servers are well suited for static content and Application Server for dynamic content, that's why most of the production environments have Web Server acting as reverse proxy to Application Server. That means a page request, static contents (such as images/Static HTML) are served by web server that interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to Application Server. e.g Apache Tomcat (Web Server) and Oracle (formerly BEA) WebLogic (Application Server). 

In simple words, the Web server's main job is to display the site content and the application server is in charge of the logic, the interaction between the user and the displayed content.

#Application server are more heavy than web server in terms of resource utilization.

#A Web server does not have inbuilt jsp plugin, where as Application server has.

#Web server supports to deploy .war files only, where as .war and .ear can be deployed on Application Server.\

#Web server does not support multi threading, where as Application server supports multi threading e.g by creating connection pool.

-K Himaanshu Shukla..

To read more Technical writeup's clickhere



Copyright © 2014 - ScrutinyByKHimaanshu

1 comment: