What is the difference between application server and web server?

前端 未结 27 1945
攒了一身酷
攒了一身酷 2020-11-22 17:03

What is the difference between application server and web server?

相关标签:
27条回答
  • 2020-11-22 17:21

    A web server runs the HTTP protocol to serve web pages. An application server can (but doesn't always) run on a web server to execute program logic, the results of which can then be delivered by the web server. That's one example of a web server/application server scenario.

    A good example in the Microsoft world is the Internet Information Server / SharePoint Server relationship. 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.

    In the Java world, there's a similar scenario with Apache and Tomcat, for example.

    0 讨论(0)
  • 2020-11-22 17:22

    In Java terms, there's one more: web container (or more strictly, servlet container). It's, say, in between web server and application server.

    A web container in Java terms is an application server that basically only implements the JSP/Servlet part of Java EE and lacks several core parts of Java EE, such as EJB support. An example is Apache Tomcat.

    0 讨论(0)
  • 2020-11-22 17:23

    On a first hand, a web server serves web content (HTML and static content) over the HTTP protocol. On the other hand, an application server is a container upon which you can build and expose business logic and processes to client applications through various protocols including HTTP in a n-tier architecture.

    An application server thus offers much more services than an web server which typically include:

    • A (proprietary or not) API
    • Object life cycle management,
    • State management (session),
    • Resource management (e.g. connection pools to database),
    • Load balancing, fail over...

    AFAIK, ATG Dynamo was one of the very first application server in late 90's (according to the definition above). In early 2000, it was the reign of some proprietary application servers like ColdFusion (CFML AS), BroadVision (Server-side JavaScript AS), etc. But none really survived the Java application server era.

    0 讨论(0)
  • 2020-11-22 17:25

    IMO, it's mostly about separating concerns.

    From a purely technical point of view, you can do everything (web content + business logic) in a single web server. If you'd do that, then the information would be embedded inside requested the HTML content. What would be the impact?

    For example, imagine you have 2 different apps which renders entirely different HTML content on the browser. If you would separate the business logic into an app-server than you could provide different web-servers looking up the same data in the app-server via scripts. However, If you wouldn't separate the logic and keep it in the web-server, whenever you change your business model, you would end up changing it in every single web-server you have which would take more time, be less reliable and error-prone.

    0 讨论(0)
  • 2020-11-22 17:28

    Biggest difference is a Web Server handles HTTP requests, while an Application server will execute business logic on any number of protocols.

    0 讨论(0)
  • 2020-11-22 17:28

    All of the above is just over-complicating something very simple. An application server contains a web server, an application server just has a couple more additions/extensions to it than standard web servers. If you look at TomEE as an example:

    CDI - Apache OpenWebBeans
    EJB - Apache OpenEJB
    JPA - Apache OpenJPA
    JSF - Apache MyFaces
    JSP - Apache Tomcat
    JSTL - Apache Tomcat
    JTA - Apache Geronimo Transaction
    Servlet - Apache Tomcat
    Javamail - Apache Geronimo JavaMail
    Bean Validation - Apache BVal
    

    You will see that Tomcat (Web container/server) is just another tool in the app servers arsenal. You can get JPA and the other tech in the web server as well if you want, but the application servers just package all of these things for your convenience. To be fully classified as an app server you essentially need to comply with a list of tools set forth by some standard.

    0 讨论(0)
提交回复
热议问题