What is the difference between application server

2019-01-01 07:59发布

What is the difference between application server and web server?

24条回答
其实,你不懂
2楼-- · 2019-01-01 08:14

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 which 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.

查看更多
泪湿衣
3楼-- · 2019-01-01 08:14

While there may be overlaps between the two (some web servers may even be used as application servers) the biggest difference IMHO is in the processing model and the session management:

In Web server processing model, the focus is on handling requests; the notion of "session" is pretty much virtual. That is to say that "session" is simulated by transferring the representation of state between client and server (hence REST) and/or serializing it to an external persistent storage (SQL Server, Memcached etc).

In Application server the session is usually more explicit and often takes form of an object living in memory of the application server for the entire duration of the "session".

查看更多
长期被迫恋爱
4楼-- · 2019-01-01 08:17

The main difference between Web server and application server is that web server is meant to serve static pages e.g. HTML and CSS, while Application Server is responsible for generating dynamic content by executing server side code e.g. JSP, Servlet or EJB.

Which one should i use?
Once you know the difference between web and application server and web containers, it's easy to figure out when to use them. You need a web server like Apache HTTPD if you are serving static web pages. If you have a Java application with just JSP and Servlet to generate dynamic content then you need web containers like Tomcat or Jetty. While, if you have Java EE application using EJB, distributed transaction, messaging and other fancy features than you need a full fledged application server like JBoss, WebSphere or Oracle's WebLogic.

Web container is a part of Web Server and the Web Server is a part of Application Server.

Application Server

Web Server is composed of web container, while Application Server is composed of web container as well as EJB container.

查看更多
栀子花@的思念
5楼-- · 2019-01-01 08:18

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.

查看更多
呛了眼睛熬了心
6楼-- · 2019-01-01 08:18

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.

查看更多
看淡一切
7楼-- · 2019-01-01 08:19

An application server is typically designed and deployed to facilitate longer running processes that will also be more resource intensive.

A web server is used for short bursts that are not resource intensive, generally. This is mostly to facilitate serving up web based traffic.

查看更多
登录 后发表回答