web servers, application servers

What is the difference WEB server, application server, HTTP server? IIS, Apache, Tomcat, Weblogic, WebSphere servers which are each belong to? These questions puzzled for a long time, finally sort out clearly:

The basic functions of the Web server to provide Web browsing service information. It only supports the HTTP protocol, HTML document format and URL. In conjunction with the client's web browser. Because the Web server protocol is the main support of HTTP, so under normal circumstances HTTP server and WEB server are equal (there is no support for protocols other than HTTP web server, the author had not verified), said the same thing.

Application server (referred to as an application server), we look at Microsoft to its definition:. "We put the application server is defined as" a shared server to execute business applications software underlying the system "as a file server to provide users with a lot of Like files, application servers allow multiple users can use the application at the same time (usually created by the client application) "

Popular speaking, Web server delivers (serves) so that browsers can view the page, but the application server provides the client application can call (call) the method (methods). The exact point, you can say: Web server dedicated to handling HTTP requests (request), but the application server is to provide for the application (serves) the business logic (business logic) by many protocols.

For example with Java EE, Web servers, mainly dealing with static pages and as a Servlet container processing, interpretation and implementation of servlet / JSP, and application servers are running business logic, mainly J2EE API terms of EJB, JNDI and JMX API, etc., but also It includes transaction processing, database connectivity and other functions, so in the enterprise applications, the application server provides powerful than the WEB server.

By such a definition, IIS, Apache, Tomcat Web server can belong, Weblogic, WebSphere application server belongs.

Apache

In the Web server, Apache Web server is pure, often paired with Tomcat. It has a powerful HTML page explanatory power, but can not explain the embedded server-side scripting code (JSP / Servlet) within a page.

Tomcat

Early Apache Tomcat is embedded in the JSP / Servlet engine explained + Apache Tomcat equivalent IIS + ASP. Later Tomcat is no longer embedded in Apache, Tomcat process is independent of the Apache process runs. Further, Tomcat Servlet has an independent and JSP container, business logic code, and code interface interaction layer separated. Therefore, someone called the lightweight Tomcat application server.

IIS

Early Microsoft IIS, is a pure Web server. Later it embeds the ASP engine can be interpreted VBScript and JScript server-side code, and then, it can double as an application server. Of course, it simply can not be compared with the J2EE application server, but Functionally, from the principle that it can barely be called an application server. Rather, it is a little of both application server function Web server.

In summary:

Apache is a pure web server, Tomcat and IIS as having the ability to perform server-side code explanation can be called as a lightweight Web server or application server with server functions. Weblogic, WebSphere J2EE because it can provide powerful features, it is absolutely no doubt of the application server. For Tomcat in an intermediate position, which can be used with the Apache Web server with pure, as may be deployed with the secondary application server and the application server:

A, Tomcat application server

So far, Tomcat has been considered Servlet / JSP API actuators, also called Servlet containers. However, Tomcat is not just that, it also provides an implementation mechanism for the JNDI and JMX API. Nevertheless, Tomcat still can not be regarded as an application server, because it does not provide support for most J2EE API's.

Interestingly, many of the Tomcat application server, usually as their Servlet container and JSP API's. Since Tomcat allows developers simply by adding his thanks, can be embedded into the Tomcat application thereof. Unfortunately, many commercial applications server does not comply with this rule.

For developers, if it is to find the use of Servlet, JSP, JNDI and JMX techniques to generate Java Web application, then select Tomcat is an excellent solution; but in order to seek support other J2EE API, then look for an application server or the Tomcat application server as a secondary, would be a good solution; third way is to find an independent J2EE API to achieve, and then combine them together to use with Tomcat. Although consolidation will bring related problems, but this approach is most effective. .

Two, Tomcat Web server

Tomcat is a Servlet and JSP container support operation. Servlet and JSP can be based on real needs, generate dynamic web content. For Web servers, Apache only supports static pages, support for dynamic page will look powerless; Tomcat is both dynamic web services, while also providing support for static pages. Although it does not have the usual fast Web server, Web server function is not as rich, but Tomcat support static content gradually expanding. Most Web servers are written in the underlying language such as C, utilizing the features of the respective platforms, thus written in pure Java Tomcat execution speed can not be compared with them.

In general, large sites are a combination of Tomcat and Apache, Apache HTTP responsible for accepting all requests from clients, and then forwards the request to the JSP Servlets and Tomcat to deal with. Tomcat after completion of treatment, the response back to Apache, Apache final response back to the client.

And in order to improve performance, you can be connected to a plurality of apache tomcat load balancing.

About WEB server, application server the difference in more detail can refer to the following article:

Popular speaking, Web server delivers (serves) so that browsers can view the page, but the application server provides the client application can call (call) the method (methods). The exact point, you can say: Web server dedicated to handling HTTP requests (request), but the application server is to provide for the application (serves) the business logic (business logic) by many protocols.

Let us carefully Road to:

Web server (Web Server)

Web server can resolve (handles) HTTP protocol. When the Web server receives an HTTP request (request), it returns an HTTP response (response), for example, a back HTML page. In order to process a request (request), Web server response (response) a static page or image, a page jump (the redirect), or to generate delegate (the delegate) dynamic response (dynamic response) to some other programs such as CGI script, JSP (JavaServer Pages) scripts, servlets, ASP (Active server Pages) scripts on the server side (server-side) JavaScript, or some other server (server-side) technology. Whether they are: How (Translator's Note script) purposes, these server-side (server-side) program usually generates an HTML response (response) to allow the browser to browse.

You know, the proxy model of the Web server (delegation model) is very simple. When a request (request) is sent to the server where the Web, only the simple request (request) is transmitted to the application processing request can be very good (request) of the (Translator's Note: The server-side script). Web server can perform only a server (server-side) and the program returns environmental response (response) (program generated), without exceeding the scope of functions. Server (server-side) typically has a transaction processing program (transaction processing), database connection (database connectivity) and message (Messaging) functions.

Although the Web server does not support transactions or database connection pool, but it can be configured (employ) a variety of strategies (strategies) to achieve fault tolerance (fault tolerance) and scalability (scalability), such as load balancing (load balancing), buffer (caching). Cluster features (clustering-features) is often mistaken for just the application server-specific features.

Application server (The Application Server)

According to our definition, as an application server, through various communication protocols, including HTTP, exposed to the business logic (EXPOSE) client application. Web server mainly deal with sending HTML to the browser for viewing, and the application server provides a way to access business logic for use by client applications. This application uses business logic as (a function or process language) a method you call the same object.

The client application server (containing the graphical user interface (GUI)) might be running on a PC, a Web server or even other application servers. Between the application server and its clients back and forth (Traveling) beyond simple information display mark. Rather, such information is the program logic (program logic). It is this logic made (takes) the data and method calls (calls) form rather than static HTML, so the client can use this to be exposed to arbitrary business logic.

In most cases, the application server through the application component (Component) Interface (API) exposing the business logic (EXPOSE) (the client application), for example based on J2EE (Java 2 Platform, Enterprise Edition) application EJB (Enterprise JavaBean) component model application server. In addition, the application server can manage their own resources, such as janitor work (gate-keeping duties), including security (security), transaction processing (transaction processing), resource pool (resource pooling), and message (messaging). Just like Web server, application server is configured with a variety of scalability (scalability) and fault tolerance (fault tolerance) technology.

one example

For example, imagine an online store (website) provides real-time pricing (real-time pricing) and effectiveness (availability) information. This site (site) is likely to provide a form (form) allows you to select a product. When you submit a query (query), the site will be to find (lookup) and returns the results embedded in HTML pages. Website can have a variety of ways to achieve this functionality. I want to introduce an application that uses server scenario and a scenario using the application server. Look in two different scenarios will help you understand the functionality of the application server.

Web server without an application server: Scenario 1

In this scenario, a Web server functionality independent online store. Get your Web server request (request), and then sent to the server (server- side) can request processing program (request) a. This program from a database or text file (flat file, Translator's Note: flat file is no special format refers to the non-binary files, such as properties and XML files, etc.) to find pricing information. Once found, the server (server-side) program information is the result expressed as (formulate) HTML form, and finally the Web server will send it to your Web browser.

Briefly, Web servers simply by responding (response) HTML page to handle HTTP requests (request).

Scenario 2: Web server with an application server

Scenario 2 and Scenario same Web server 1 is generated or the delegate (Delegates) response (response) to the script (Translator's Note: the server (server-side) program). However, you can find the pricing of the business logic (business logic) into the application server. Because of this change, the script simply call the application server's lookup service (lookup service), and not already know how to find data and then expressed as (formulate) a response (response). Then when the script generate HTML response (response) can use the service to return the results.

In this scenario, the application server provides (serves) the business logic for the pricing of the product information query. (Server) This function (functionality) does not indicate how the display and the client details to use this information, but rather the client and application server just to transfer data back and forth. When a client calls the application server's lookup service (lookup service), this service simply to find and return the results to the client.

Isolated by generating (response-generating) HTML code from the response out in the pricing application (search) logic reusability stronger. Other clients, such as cash registers, you can also call the same service (service) to customers as a checkout clerk. In contrast, in Scenario 1 the pricing lookup service is not reusable because the information embedded in an HTML page.

All in all, the model in Scenario 2, the Web server to handle HTTP requests (request) by responding to an HTML page, and the application server is to provide application logic by processing pricing and availability requests (availability) (request).

Warning (Caveats)

Now, XML Web Services has made an application server and Web server boundaries confused. Capacity by transmitting an XML payload (payload) to the server, Web server can now handle data and response (response) of the previous application server the same amount.

In addition, most application servers are now also includes a Web server, which means you can put as a Web server is a subset (subset) application server. Although the application server contains a Web server functionality, but developers rarely application server deployment (deploy) into this function (capacity) (Translator's Note: This function is a function of both the application server there Web server function). On the contrary, if required, they will usually separate Web server configuration, and after a previous application server. This separation of functions helps to improve performance (a simple Web requests (request) will not affect the application server), separated configuration (dedicated Web servers, clusters (clustering), etc.), and to the best products select leeway.

Guess you like

Origin blog.csdn.net/anwarkanji/article/details/90524691