Webserver and Application Server

A  lot of views all around the web could be found regarding the discussion on difference between a Web-server and an Application server.Even I am not sure of the exact difference between the two.I am compiling this post so that we can try to shed out some light on this so as to come with some understanding on this topic terms pf a laymen.I would request the readers of this post to share their views using simple language and without using vague terms. Lets start..

I read an example on some forum which I quite liked.It stated as below.

“Web-server actually process static content, like when we request to access a webpage like Google , it will go to the web server first and as is expected and the Google home page will be displayed .Now application server comes into picture. When we enter something in search box , like something we wanna search ,now here application server comes into action as the web server alone  cannot take the dynamic request.The web server  can employ various strategies for fault tolerance and scalablity such as load balancing, caching, and clustering but it cannot search the database and do lot of processing.Application server is actually a software.”

This means that the web server accepts requests from the user from a browser using HTTP protocol and then forward it to application server for further action.Lets note a point here that the capability of the application server is just not limited to accepting requests using HTTP protocol, it can also accept requests using other protocol such as RMI/RPC whereas the web-server just serves to the HTTP request.

Eg of webservers : Apache HTTP Server, Sun ONE Web Server, iPlanet Web Server

Web Servers are mostly designed to serve static content. Though most of the Web Servers are having plugins to support scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP content.Most of the application servers have Web Server as integral part of them, that means Application Servers are capable of whatever Web Server is capable of. Additionally an Application Server have components and features to support Connection Pooling, Object Pooling, Transaction Support, Messaging services etc.

As web servers are well suited for static content and app servers for dynamic content, most of the production environments have web server acting as reverse proxy to app server.The web server resides between the web browser and application server and the request from the user’s browser is first intercepted by the web server and then forwarded to the app server. This means when a page request comes from the user , static contents such as images/static html is served by web server that interprets the request and then using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to app server.Then the application server exposes the application logic  for use by client application programs. The application program can use this logic just as it would call a method on an object.In most cases, the app server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on J2EE (Java 2 Platform, Enterprise Edition) application servers.

Example of such configuration is

  1. Apache HTTP Server and BEA WebLogic Server. Apache HTTP Server is Web Server and BEA WebLogic is Application Server.
  2. Apache HTTP Server and Tomcat Server. Apache HTTP Server is Web Server and Tomcat is Application Server.
  3. Internet Information Server and SharePoint Server. IIS is a web server; SharePoint is an application server. SharePoint sits “on top” of IIS, executes specific logic, and serves the results via IIS.

So ,question arises that when an application server not only hosts an application but also can perform the functions of a webserver then whats the need of a webserver. The answer would be that an architect would never choose to expose the server on which his application is hosted, directly to the users request, keeping security in my mind.

Readers please pour in your suggestions and thoughts.

Also a relevant discussion could be found on http://www.javaworld.com/javaqa/2002-08/01-qa-0823-appvswebserver.html

One Response to“Webserver and Application Server”

  1. Sreekanth Yelicherla
    April 30, 2013 at 8:26 PM #

    There is no standard definition to Application server. Iplanet is not a web server, it is an application server. It can be easily understood, Iplanet serves JSP and anything which serves JSP is an Application server for Java (recollect that JSP is for dynamic content). This is the reason why both Tomcat and Iplanet are referred to Application Servers and Apache as web-server as it can not fully support dynamic content. In one way, it is not entirely true that a web server cannot address dynamic content at all. It can, very well but only to a limited extent. We have Apache running dynamic content in real world, it it is just that their scope is limited.

    IIS is for ASP (similar to JSP which is for dynamic content). IIS is technically an Application Server similar to Tomcat,Jboss, Iplanet etc.

    “Application server” is a general term. A server on which an application is deployed is an “Application Server”. It can be a physical/virtual server (e.g. IBM WAS, Web Logic, any actual physical/virtual computer) or a web server (a server which serves the web requests, e.g. Apache, Tomcat, Jboss etc). Hence, the terms Web server and Application server are interchanged in reality. As a matter of fact, Microsoft on its website in some resource pages calls IIS as web server and in some other resources as Application server.

    Finally, there is nothing called Application Server. We have only web servers. Application servers should be referred to hardware layer than software layer. But, once JSP/ASPs evolved, the word Application server has been more associated to the s/w than the h/w by the developers. Nothing more/less.

Leave a Reply

Your email address will not be published. Required fields are marked *

(Required)

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com