Talking about the difference between Web server and application Server _ server other

Source: Internet
Author: User
Tags connection pooling html form web services

In layman's terms, the Web server Transfer (serves) page allows browsers to browse, whereas an application server provides a method (methods) that the client application can invoke (call). Specifically, you can say that the Web server deals specifically with HTTP requests, but the application server uses many protocols to provide (serves) business logic (business logic) to the application.

Now let's take a careful path:

Web Server (Web Server)

The Web server can parse (handles) the HTTP protocol. When a Web server receives an HTTP request, it returns an HTTP response (response), such as sending back an HTML page. In order to process a request, the Web server can respond to (response) a static page or picture, make a page jump (redirect), or delegate a dynamic response (dynamically response) to the generation (delegate) To some other programs such as CGI scripts, JSP (JavaServer Pages) script, servlets,asp (Active Server pages) script, server-side (server-side) JavaScript, or some other server-side (server-side) technology. Regardless of their purpose, these server-side (server-side) programs typically produce an HTML response (response) to allow browsers to browse.

You know, the proxy model for the Web server (delegation models) is very simple. When a request is sent to a Web server, it simply passes the request to a program that can handle the request very well (the server-side script). The Web server simply provides an environment that can perform server-side (server-side) programs and return (program-generated) responses (response) without exceeding the scope of the function. Server-side (server-side) programs typically have transaction processing (transaction processing), database connectivity (DB connectivity), and messages (messaging).

Although the Web server does not support transaction processing or database connection pooling, it can configure (employ) various policies (strategies) to implement fault tolerance (fault tolerance) and scalability (scalability), such as load balancing balancing), buffering (caching). Cluster features (clustering-features) are often mistaken for the proprietary features of the application server.

   Application Server(the application Server) 
According to our definition, as an application server, it can include HTTP and expose business logic to (expose) client applications through a variety of protocols. The Web server primarily handles sending HTML to browsers for browsing, while application servers provide access to business logic for use by client applications. The application uses this business logic just as you would call a method of an object (or a function in a procedure language).

The client of the application server (which contains a graphical user interface (GUI)) may run on a PC, a Web server, or even another application server. The information that traveling between the application server and its clients is not limited to simple display tags. Instead, this information is the programming logic (program logic). It is because this logic obtains the form of (takes) data and method calls (calls) rather than static HTML, so that the client can use this exposed business logic as it pleases.

In most cases, application servers expose business logic (expose) (to client applications) through the application Interface (API) of the component (component), for example, based on Java 2 Platform, Enterprise Edition The EJB (Enterprise JavaBean) component model of the application server. In addition, the application server can manage its own resources, such as looking at the gate's work (gate-keeping duties) including security, transaction processing (transaction processing), resource pool (resource pooling ), and message (messaging). As with Web servers, application servers are configured with a variety of extensible (scalability) and fault-tolerant (fault tolerance) technologies.

An example
For example, imagine an online store (web site) that provides real-time pricing (real-time pricing) and effectivity (availability) information. This site is likely to provide a form (form) that allows you to select products. When you submit the query, the site looks up (lookup) and returns the results inline in an HTML page. There are many ways in which a Web site can implement this functionality. I want to introduce a scenario that does not use an application server and a scenario that uses an application server. Looking at the differences in the two scenarios will help you understand the functionality of the application server.

Scenario1: With no application serverWebServer 

In this scenario, a Web server provides the functionality of an online store independently. The Web server obtains your request, and then sends it to the server side (Server-side) to process the request. This program looks up pricing information from a database or text file (flat file, translator Note: Flat files that are not in a special format, such as properties and XML files, etc.). Once found, the server-side (server-side) program represents the result information as a (formulate) HTML form, and the last Web server sends it to your Web browser.

In short, the Web server simply handles HTTP requests (request) through a response (response) HTML page.

Scenario2: With the application serverWebServer 

Scenario 2 and Scenario 1 are the same as the Web server or the generation delegate (delegates) of the response (response) to the script (the server-side (server-side) program). However, you can put the business logic of finding pricing (business logic) on the application server. As a result of this change, this script simply invokes the lookup service of the application server (lookup services) instead of knowing how to find the data and then represent (formulate) a response (response). When the script generates an HTML response (response), it can use the return result of the service.

In this scenario, the application server provides (serves) business logic for querying pricing information for a product. This feature (functionality) does not indicate the details of how the display and the client can use this information, whereas the client and the application server simply transmit data back and forth. When a client invokes the application server's lookup services (lookup service), the service simply finds and returns the results to the client.

The pricing (lookup) logic is more reusable within an application by separating from the code that generates the response (response-generating) HTML. Other clients, such as cash registers, can also call the same service to checkout the customer as a clerk. In contrast, the pricing lookup service in Scenario 1 is not reusable because the information is embedded in the HTML page.

In summary, in the Scenario 2 model, the Web server handles HTTP requests by responding to HTML pages, while the application server provides application logic by processing pricing and validity (availability) requests (request).

Warning (caveats)
Now, XML Web Services has confused the boundaries between the application server and the Web server. By delivering an XML payload (payload) to the server, the Web server can now handle data and response (response) as much as the previous application server.

In addition, most application servers now contain Web servers, which means that the Web server can be treated as a subset of the application Server (subset). Although the application server contains the functionality of the Web server, developers rarely deploy application server (deploy) into this function (capacity), which refers to the functionality of both the application server and the Web server. Instead, they typically configure the Web server independently, and the application server one after the other, if needed. This separation of functionality helps improve performance (simple Web requests do not affect application servers), separate configurations (dedicated Web servers, clusters (clustering), and so on), and leave room for the best product selection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.