Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,654 members, 7,809,477 topics. Date: Friday, 26 April 2024 at 10:14 AM

What's The Difference Between A Webserver And An Application Server? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / What's The Difference Between A Webserver And An Application Server? (2287 Views)

Help With Mysql On Webserver / Difference Between Computer Science And Computer Engineering / Difference Between A Programmer And A Web Developer? (2) (3) (4)

(1) (Reply) (Go Down)

What's The Difference Between A Webserver And An Application Server? by bigboyslim(m): 11:59am On May 16, 2009
I would really like to know the difference between these two. Are they the same? are they different? can one perform the function of the other? Are both needed in building Distributed applications? Nairaland gurus, your opinions will be highly valued.
Re: What's The Difference Between A Webserver And An Application Server? by Seun(m): 3:08pm On May 16, 2009
A webserver (like Apache, Nginx) serves files and images over the web. 
An application server (like CherryPy, JBoss) serves applications over the web.

Many application servers can serve files, and most web servers have plugins to enable them serve applications, but a webserver's primary purpose is to serve files and an app server's primary purpose is to render dynamic pages based on programs written in a particular language (Java, Python).
Re: What's The Difference Between A Webserver And An Application Server? by Otuyelu(m): 6:51pm On May 18, 2009
Web servers are optimized to serve potentially millions of pages while tracking minimal amount of user state data;
Application servers are optimized to host single applications to few hundred to a thousand users, while tracking massive amounts of data of user state. 
A lot of sites use a combination of the two to provide services, take yahoo.com for instance, the home page is served by a bank of Web servers, once you click on one of the services such as games or Instant Messaging you are now interfaced to an Application server.
Re: What's The Difference Between A Webserver And An Application Server? by Nobody: 9:45pm On May 18, 2009
I think yahoo's homepage runs on both application server and web server.

Like i always tell my students.

A web server does the job of replying to your request by checking if the requested file is on the server, if it is there, it gives it to the user as it is using HTTP. If not, It tells you "page not found" AKA 404 or some other reasons


An application server is totally different. It is more like when you install a yahoo toolbar on firefox (so yahootoolbar=appserver & firefox=webserver).
an application server extends what a web server will be able to do.
for instance process dynamic pages, manage user state(session), connect to database etc.

you can install a web server and be good to go.
an application server will need to run on a webserver, infact while installing an application server like PHP's
you will need to tell the installer what web server you want to install PHP application server to.

just like you will need to specify what browser you are installing a yahoo toolbar for.
Re: What's The Difference Between A Webserver And An Application Server? by bigboyslim(m): 10:41pm On May 18, 2009
Very insightful responses. Thanks guys.

I'm currently using Apache Tomcat as my webserver. Any suggestions on what application server would work best with Tomcat? I'm thinking JBoss
Re: What's The Difference Between A Webserver And An Application Server? by enohj2ee(m): 6:57am On May 19, 2009
Taking a big step back, a Web server serves pages for viewing in a Web browser, while an application server provides methods that client applications can call. A little more precisely, you can say that:
A Web server exclusively handles HTTP requests, whereas an application server serves business logic to application programs through any number of protocols.

Let's examine each in more detail.

The Web server

A Web server handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.
Understand that a Web server's delegation model is fairly simple. When a request comes into the Web server, the Web server simply passes the request to the program best able to handle it. The Web server doesn't provide any functionality beyond simply providing an environment in which the server-side program can execute and pass back the generated responses. The server-side program usually provides for itself such functions as transaction processing, database connectivity, and messaging.
While a Web server may not itself support transactions or database connection pooling, it may employ various strategies for fault tolerance and scalability such as load balancing, caching, and clustering—features oftentimes erroneously assigned as features reserved only for application servers.
The application server
As for the application server, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object (or a function in the procedural world).
Such application server clients can include GUIs (graphical user interface) running on a PC, a Web server, or even other application servers. The information traveling back and forth between an application server and its client is not restricted to simple display markup. Instead, the information is program logic. Since the logic takes the form of data and method calls and not static HTML, the client can employ the exposed business logic however it wants.
In most cases, the server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on J2EE (Java 2 Platform, Enterprise Edition) application servers. Moreover, the application server manages its own resources. Such gate-keeping duties include security, transaction processing, resource pooling, and messaging. Like a Web server, an application server may also employ various scalability and fault-tolerance techniques.
An example
As an example, consider an online store that provides real-time pricing and availability information. Most likely, the site will provide a form with which you can choose a product. When you submit your query, the site performs a lookup and returns the results embedded within an HTML page. The site may implement this functionality in numerous ways. I'll show you one scenario that doesn't use an application server and another that does. Seeing how these scenarios differ will help you to see the application server's function.
Scenario 1: Web server without an application server
In the first scenario, a Web server alone provides the online store's functionality. The Web server takes your request, then passes it to a server-side program able to handle the request. The server-side program looks up the pricing information from a database or a flat file. Once retrieved, the server-side program uses the information to formulate the HTML response, then the Web server sends it back to your Web browser.
To summarize, a Web server simply processes HTTP requests by responding with HTML pages.
Scenario 2: Web server with an application server
Scenario 2 resembles Scenario 1 in that the Web server still delegates the response generation to a script. However, you can now put the business logic for the pricing lookup onto an application server. With that change, instead of the script knowing how to look up the data and formulate a response, the script can simply call the application server's lookup service. The script can then use the service's result when the script generates its HTML response.
In this scenario, the application server serves the business logic for looking up a product's pricing information. That functionality doesn't say anything about display or how the client must use the information. Instead, the client and application server send data back and forth. When a client calls the application server's lookup service, the service simply looks up the information and returns it to the client.
By separating the pricing logic from the HTML response-generating code, the pricing logic becomes far more reusable between applications. A second client, such as a cash register, could also call the same service as a clerk checks out a customer. In contrast, in Scenario 1 the pricing lookup service is not reusable because the information is embedded within the HTML page. To summarize, in Scenario 2's model, the Web server handles HTTP requests by replying with an HTML page while the application server serves application logic by processing pricing and availability requests.
Caveats
Recently, XML Web services have blurred the line between application servers and Web servers. By passing an XML payload to a Web server, the Web server can now process the data and respond much as application servers have in the past.
Additionally, most application servers also contain a Web server, meaning you can consider a Web server a subset of an application server. While application servers contain Web server functionality, developers rarely deploy application servers in that capacity. Instead, when needed, they often deploy standalone Web servers in tandem with application servers. Such a separation of functionality aids performance (simple Web requests won't impact application server performance), deployment configuration (dedicated Web servers, clustering, and so on), and allows for best-of-breed product selection.


Difference between AppServer and a Web server

(1) Webserver serves pages for viewing in web browser, application server provides exposes businness logic for client applications through various protocols
(2) Webserver exclusively handles http requests.application server serves bussiness logic to application programs through any number of protocols.
(3) Webserver delegation model is fairly simple,when the request comes into the webserver,it simply passes the request to the program best able to handle it(Server side program). It may not support transactions and database connection pooling.
(4) Application server is more capable of dynamic behaviour than webserver. We can also configure application server to work as a webserver.Simply applic! ation server is a superset of webserver.
Web Server serves static HTML pages or gifs, jpegs, etc., and can also run code written in CGI, JSP etc. A Web server handles the HTTP protocol. Eg of some web server are IIS or apache.
An Application Server is used to run business logic or dynamically generated presentation code. It can either be .NET based or J2EE based (BEA WebLogic Server, IBM WebSphere, JBoss).
A J2EE application server runs servlets and JSPs (infact a part of the app server called web container is responsible for running servlets and JSPs) that are used to create HTML pages dynamically. In addition, J2EE application server can run EJBs - which are used to execute business logic.
An Application server has a 'built-in' web server, in addition to that it supports other modules or features like e-business integration, independent management and security module, portlets etc.
An application server is technology where developers can create, test, and execute application components. Application servers are typically J2EE-based, running EJBs or other Java components. Application servers are designed to create true applications with complex business logic, and have scalability features such as load balancing, fail-over, and process distribution. In other words, it's primarily a development environment.

In contrast, Web servers are technology designed to create and deploy Web site, serving up content more so than applications. They both use Web interfaces, but Web servers are more about the interface than the back-end logic. In other words, Web servers serve up content.

As time moves on Web servers are looking more like application server, as they adopt their functionality. I can understand the confusion.
Re: What's The Difference Between A Webserver And An Application Server? by Afam(m): 8:46am On May 19, 2009
I think in providing responses and/or answers to questions on a public forum like this one it makes perfect sense to give credit to the author of any material reproduced, it is just right and proper to do so.
Re: What's The Difference Between A Webserver And An Application Server? by yuppydon(m): 1:05pm On May 19, 2009
A webserver like IIS and apache resolves domain name on the website to the IP of the system hosting it and thereafter sends the message to the appserver (Tomcat, websphere, etc)to do any logic involved. The output/response is sent back to the webserver and it serves it to the user.
In summary users over the internet interacts to the webserver either unsecure(http) or secured(https) protocols. users are not expected to interact with the appserver or database server directly.
Re: What's The Difference Between A Webserver And An Application Server? by SubMacGun(m): 10:55pm On May 19, 2009
Big Big Grammar - You ask simple question Egostic Nigerians submit complex answers - I am sure the poster is more confused now

1. Web servers are computers on the internet that host websites

2. An application server is a server program in a computer in a distributed network that provides the business logic for an application program. it usually consist of the following

1. FrontEnd - Your Computer

2 A middle-tier business logic application or set of applications, - local area network or intranet server

3 A third-tier, - back-end, database and transaction server, sometimes on a mainframe or large server

Simple as A B C

1 Like

Re: What's The Difference Between A Webserver And An Application Server? by Nobody: 10:00am On May 20, 2009
SubMacGun:

I am sure the poster is more confused now


especially when Domain name server has been confused with a web server


SubMacGun:


Simple as A B C

ask me, yours is more confusing.
Re: What's The Difference Between A Webserver And An Application Server? by bigboyslim(m): 11:27am On May 20, 2009
webdezzi:

especially when Domain name server has been confused with a web server


ask me, yours is more confusing.

I totally agree with you. I think a domain name server as the name implies resolves domain names to ip addresses. Not the function of a webserver

I dont also agree that a webserver is a computer on the internet. A webserver is a program not a computer.

I agree with most of the other explanations people have given though. The only things is I still dont understand what business logic means. Could someone shed more light on this and if possible with examples.
Re: What's The Difference Between A Webserver And An Application Server? by Nobody: 2:57pm On May 20, 2009
I guess we have somethings in common, nothing confuses ppl than the word "business logic"
ppl tend to interpret business=money, finance, etc

for the sake of clarification, i wud opt for just "logic".

here is a link http://www.pcmag.com/encyclopedia_term/0,2542,t=business+logic&i=39074,00.asp

I think SubMacGun is right about the web server from the hardware perspective
just like when you refer to your computer as server. like dedicated server, shared server. but not what the poster meant
more reason i said his is more confusing.

(1) (Reply)

Programming Your Own Code Syntax Highlighter / Java REPL / A Ponzi Website Needed Urgently

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 41
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.