What is the difference between application server and web server?

应用程序服务器和Web服务器有什么区别?


Most of the times these terms Web Server and Application server are used interchangeably.

Following are some of the key differences in features of Web Server and Application Server:

  • Web Server is designed to serve HTTP Content. App Server can also serve HTTP Content but is not limited to just HTTP. It can be provided other protocol support such as RMI/RPC
  • Web Server is mostly designed to serve static content, though most Web Servers have 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 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.
  • 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 servicing 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 app server
  • Example of such configuration is Apache Tomcat HTTP Server and Oracle (formerly BEA) WebLogic Server. Apache Tomcat HTTP Server is Web Server and Oracle WebLogic is Application Server.

    In some cases the servers are tightly integrated such as IIS and .NET Runtime. IIS is web server. When equipped with .NET runtime environment, IIS is capable of providing application services.


    Both terms are very generic, one containing the other one and vice versa in some cases.

  • Web server : serves content to the web using http protocol.

  • Application server : hosts and exposes business logic and processes.

  • I think that the main point is that the web server exposes everything through the http protocol, while the application server is not restricted to it.

    That said, in many scenarios you will find that the web server is being used to create the front-end of the application server, that is, it exposes a set of web pages that allow the user to interact with the business rules found into the application server.


    This is a detailed answer with some scenarios to clearly understand the difference,similarity and how both can work in conjunction and all

    Application Server is a term that sometimes is mixed with a web server . While a web server handles mainly HTTP protocols , the application server deals with several different protocols, including, but not limited, to HTTP .

    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. The application server is working in conjunction with the web server, where one displays and the other one interacts.

    The information traveling back and forth between the server and its client is not restricted to simple display markup, but to interaction between the two.

    In most cases, the server creates this interaction through a component API , such as J2EE (Java 2 Platform), EJB (Enterprise JavaBean) and other different application software models.

    在这里输入图像描述

    An example:

    The best way to understand the difference between the scenarios where an application server works with the web server versus a scenario where there isn't an application server is through an online store.

    Scenario 1: Web server without an application server

    you have an online store with only a web server and no application server. The site will provide a display where you can choose a product from. When you submit a query, the site performs a lookup and returns an HTML result back to its client. The web server sends your query directly to the database server (be patient, I will explain this one in our next nugget) and waits for a response. Once received, the web server formulates the response into an HTML file and sends it to your web browser. This back and forth communication between the server and database server happens every time a query is run.

    Scenario 2: Web server with an application server

    if the query you want to run has already been done previously and no data has changed since then, the server will generate the results without having to send the request to the database server. This allows a real-time query where a second client can access the same info and receive real time, reliable information without sending another duplicate query to the database server. The server basically acts as an intermediate between the database server and the web server. This allows the information pulled to be reusable while in the first scenario, since this info is embedded in a particular and "customized" HTML page, this is not a reusable process. A second client will have to request the info again and receive another HTML embedded page with the info requested -highly inefficient. Not to mention that this type of server is very flexible due to its ability to manage its own resources, including security, transaction processing, messaging and resource pooling.

    To support such a variety of complex tasks this server must have a built in redundancy, great processing power and high amount of RAM to handle all the data it's pulling in real time.

    Hope this helps.

    链接地址: http://www.djcxy.com/p/17328.html

    上一篇: jQuery Ajax错误处理,显示自定义异常消息

    下一篇: 应用程序服务器和Web服务器有什么区别?