I am new to web development and just started exploring the things. I read about how web page is processed and sent to client by a web server but I got confused with application server. what is the difference between them ? why app. server is needed ? and few examples of both of them .
2
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. Including, and not limited to, server 500 errors, redirects and various content types.
A web server may respond with a content type that supports non-HTML formats. Such as PDF files, binary files, and even JSON/XML responses. The key factor in understanding that these requests came from a web server is understanding that response is a HTTP response. The content in the response is just an application specific content type.
A web server may run multiple CGI languages to provide the HTTP responses. These can include Python, PHP, Java and ASP (among others). These languages operate under the web server, but in turn provide valid HTTP responses. There for, it’s still a web server.
Application Server Definition
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.
Application servers tend to operate in TCP/IP communications. Including sockets, and other Internet low-level communications. It’s possible for an application to use a web server as it’s hosting environment.
Examples of tools that would require an application server could be, a gaming server, a chat server, a video conferencing server, a cloud-based accounting application, etc.. etc..
In most cases application servers wrap their business logic under an API layer. That API layer can be access via a common protocol the client supports, or via custom socket communication. There are multiple development platforms that have all these things built-in for the developer. They include platforms like J2EE or .NET
2
Technically, they mean the same thing. In colloquial use, however, a “web server” generally means a server that produces web pages that are meant to be consumed by people with web browsers.
An “application server,” on the other hand, uses HTTP as a transport layer for one program to communicate with another, generally using data exchange formats such as JSON or XML that aren’t meant to be rendered as a document.
Of course, if the same server provides both HTML pages and an API to programatically access the underlying data, the distinction can get a bit blurry…
1