Introduction to Web servers and application servers

Source: Internet
Author: User
Tags connection pooling jboss

In layman's words, Web server delivery pages allow the browser to browse, whereas the application server provides a method (methods) that the client application can invoke (call). To be exact, you can say that the Web server is dedicated to HTTP requests (request), but the application server is providing (serves) business logic for the application through a number of protocols.

1. The application server processes the business logic, and the Web server is primarily for the customer to access through the browser.
2. The application server processes the business logic, and the Web server is used to process the HTML file. Web servers are usually simpler than application servers, such as Apache, a Web server, and JBoss is an EJB application server.

Application server: Weblogic, Tomcat, Jboss
Web Application Server : IIS, Apache

Web servers (Web server)

  The Web server can parse the (handles) HTTP protocol. When the Web server receives an HTTP request (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 (response) to a static page or picture, perform a page jump (redirect), or delegate the generation of dynamic Responses (response) (delegate) Give some other programs such as CGI scripts, JSP (JavaServer Pages) scripts, servlets,asp (Active server Pages) scripts, server-side (server-side) JavaScript, or some other server-side (server-side) technology. These server-side (server-side) programs typically produce an HTML response (response) to allow the browser to navigate, regardless of the purpose of their (translator's note: script).

You know, the Web server's proxy model (delegation models) is very simple. When a request is sent to the Web server, it simply passes the request to the program that can handle the request (the Translator note: 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 features such as transaction processing (transaction processing), database connection (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) for fault tolerance (fault tolerance) and extensibility (scalability), such as load balancing balancing), buffered (caching). Cluster features (clustering-features) are often mistaken for only the proprietary features of the application server.

Application Server (Application server)

According to our definition, as an application server, it exposes commercial logic to (expose) client applications through various protocols that can include HTTP . The Web server primarily handles sending HTML to the browser for browsing, and the application server provides 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 procedural language).

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

In most cases, the application server exposes the business logic (expose) (to the client application) through the application Interface (API) of the component (component) , such as the 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 work of the Gate (gate-keeping duties) including security, transaction processing (transaction processing), resource pool (resource pooling ), and messages (messaging). Like Web servers, application servers are configured with a variety of extensible (scalability) and fault tolerant (fault tolerance) technologies .

2 Analyzing the differences between Web servers

For example, imagine an online store (website) that provides real-time pricing (real-time pricing) and validity (availability) information. This site is likely to provide a form that allows you to select products. When you submit a query, the site searches (lookup) and returns the results inline in an HTML page. Web sites can be implemented in a number of ways. I want to describe a scenario that does not use an application server and a scenario that uses an application server. Looking at the differences between the two scenarios will help you understand the functionality of the application server.

Scenario 1: A Web server without an application server

In such a scenario, a Web server independently provides the functionality of the online store. The Web server obtains your request and then sends it to the server-side (server-side) program that can process the request. This program looks for pricing information from a database or text file (flat file, translator Note: Flat files refers to non-binary documents that have no special format, such as properties and XML files, etc.). Once found, the server-side (server-side) program represents the resulting information in the form of (formulate) HTML, and the last Web server sends it to your Web browser.

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

Scenario 2: A Web server with an application server

Scenario 2 and Scenario 1 are the same as a Web server or a response (response) generation Delegate (delegates) to the script (translator Note: server-side (server-side) program). However, you can put the business logic of the lookup pricing on the application server. Because of this change, this script simply invokes the application server's lookup service (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) the business logic for querying the pricing information for the product. This feature (functionality) does not indicate details about how the display and the client can use this information, whereas the client and application servers simply send data back and forth. When a client invokes the lookup service of an application server, the service simply finds and returns results to the client.

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

All in all, in the model of Scenario 2, the Web server handles HTTP requests (request) 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 of application servers and WEB servers. By transmitting 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 Web servers can be treated as a subset of application servers (subset). Although the application server contains the functionality of the Web server, developers rarely deploy the application server (deploy) to this function (capacity) (Translator Note: This function refers to both the functionality of the application server and the functionality of the Web server). Conversely, if required, they will typically have a Web server configured independently, and the application server is one after the other. This separation of functionality helps improve performance (simple Web requests (request) Do not affect application servers), separate configurations (dedicated Web servers, clusters (clustering), and so on), and give the best product selection leeway.

Introduction to Web servers and application servers

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.