What is the difference between a Web server and an application server

Source: Internet
Author: User
Tags connection pooling html form html page http request resource

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 servers (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.

Scenario 1: Web server with no application server

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.

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.