Skip to main content

What is difference between Web Server and Application Server ?


Hemant
Kurmi
Web Server Definition

A web server is a service that handles specifically requests in the HTTP protocol format. The server responses to requests made using the HTTP format, and in turn responds using a valid HTTP response. All responses from a web server follow the W3 standards for HTTP protocols.Web server can be either a computer program or a computer running a program that is responsible for accepting HTTP requests from clients, serving back HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects on it.This is mainly used for Servlets and JSP.

Or we can say Web server can be either a computer program or a computer running a program that is responsible for accepting HTTP requests from clients, serving back HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects on it.
The Web Server does not support the concept of multi-threading

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. That means while service a page request, static contents such as images/Static html is 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 app server

Some more defination:-
A Web server is process running on a machine that "listens" specifically on TCP/IP Channel using one of the "internet" protocols, (http, https, ftp, etc..) and does whatever it does based on those incoming requests... Generally, (as origianly defined), it fetched/generated and returned an html web page to the client, either fetched from a static html file on the server, or constructed dynamically based on parameters in the incoming client request.


Some Web Server  are 
Tomcat : Servlet
Jetty : Servlet
Apache : Php, CGI

Application Server 

An application server is a service that handles specifically requests for business operations, and performs business logic. It is not limited to the HTTP protocol, but can operate using that protocol if it fits the business requirements.
It can be provided other protocol support such as RMI/RPC
In Application Server we have features like connection pooling,
isolation pooling, multi-threading, and majorly the Transaction feature which is not there in Web Server.Applicatin server supports distributed transaction and EJB's
Web servers support to deploy .war files only while Application servers support to deploy .war and .ear files.It can also provid other protocol support such as RMI/RPC


Some Application Servers are 

WAS : EJB
JBoss : EJB
WebLogic Application Server : EJB

Some more task taht are done by Application server but not web server are
1)A (proprietary or not) API
2)Load balancing, fail over...
3)Object life cycle management
4)State management (session)
5)Resource management (e.g. connection pools to database)



You may also like:-

How to Reduce Garbage-Collection Pause Time?

4 Mains causes of Long Garbage Collection Pause?

How Application Performance get impacted by Garbage Collection?

Java Performance Tuning options Java heap

Why Memory leak in Java ?

What is a Memory Leak in java?

What is Garbage collector in java and how it works?

What is Garbage Collector Compaction in Java?

What are Java heap Young, Old and Permanent Generations?

What is difference between Web Server and Application Server ?

What is the maximum ram for 32 bits and 64 bits computer?

Some Amazing fact about memory (petabyte,exabyte,zettabyte) And How much data exists on the Web?

Now have some jokes:-
Best Alok Nath jokes    Best C.I.D. returns Jokes    Rajinikanth 99 KILLING JOKES Best Kejriwal jokes  Jethalal JOKES     Husband wife awesome jokes  Winners at 59th Idea Filmfare Awards 2013      Girl Friend boy Friend Awesome jokes    Hi-tech salespeople DictionarY   Student Teacher ever best jokes   FriendShip SMS and Quotes
Hansa Praful jokes     Puzzle Messages     Life SMS    WhatsApp Status messages  Sweat Msg on MAA    Seminar of wifes   jokes on Husbands
What's Marriage?(jokes)   Smart kids jokes(god is missing)
Amazing mathematics of life    TV Anchor joke    Best suspense jokes jokes-on-husbands

Popular posts from this blog

What are Java heap Young, Old and Permanent Generations?

The Java heap is dived into two parts i.e. Young generation and old generation. Young generationYoung generation  memory is 40% of Maximum Java Heap. It consists of two parts, Eden space and Survivor Space. Eden SpaceInitially objects are created in this  Part of Java Heap , here most objects die and quickly are cleaned up by the minor Garbage Collectors (It only runs in young generation and its frequency is high in compared to major garbage collector). Usually any new objects created inside a Java Method go into Eden space and the objects space is reclaimed once the method execution completes. Whereas the Instance Variables of a Class usually lives longer until the Object based on that class gets destroyed. When Eden fills up it causes a minor collection, in which some surviving objects are moved to Survivor Space or an older generation. Survivor Space  The pool containing objects that have survived the garbage collection of the Eden space The parameter Survivor Ratio can be used to tune…

Compression of HttpServletRequest and HttpServletResponse by gzip encoding

Description 
This filter is on HTTP headers in a HttpServletRequest, compress data written to the HttpServletResponse, or decompress data read from the request. When supported by the client browser, this can potentially greatly reduce the number of bytes written across the network from and to the client. As a Filter, this class can also be easily added to any J2EE 1.3+ web application.





Installation

1).Add the pjl-comp-filter-XX.jar file containing CompressingFilter to your web application's WEB-INF/lib directory.

2).Add the following entries to your web.xml deployment descriptor:

 <filter>
  <filter-name>CompressingFilter</filter-name>
  <filter-class>com.planetj.servlet.filter.compression.CompressingFilter</filter-class>
 </filter>

 <filter-mapping>
  <filter-name>CompressingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

The below data is of my application where i tested this compression technique…

Why Memory leak in Java ?

Memory leaks is a common error in programming, especially when using languages that have no built-in automatic garbage collection, such as C and C++.  In these type of programming languages when you need memory then you have to allocate the memory from OS and when your task completed then you have to release the memory manually. Means developer is only responsible for memory management and it depends on once programming . But languages like java  has there own automatic memory management. Java Virtual Machine periodically checks which objects in memory are still being used and which are not. Unused objects are removed from the memory  and the memory  is  reused again. This process is called garbage collection and the corresponding piece of JVM is called Garbage Collector, or GC.
So memory management in java is fully depended on garbage collector. But Garbage Collector will run according to it s algorithms used and developer can only request Garbage Collector . But is not necessary that …