Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between web server, application server and database server

I read somewhere that a web application consists of a web server, application server and a database server. What is the difference between these three ?


I asked this question because I remember when I hosted a website, all I had was a https login to the control panel of the website, in which I put all my files in htdocs folder. There were no three separate things like the web server, application server and the database server.

like image 693
OneMoreError Avatar asked Oct 24 '12 04:10

OneMoreError


People also ask

What is the difference between Web server and application server and database server?

Web servers receive a client request and retrieve content from the pertinent database to provide to the client. By contrast, application servers also facilitate web content to clients but are capable of processing dynamic requests.

What is difference between server and Web server?

The difference between a Server and a Web server is that the server is a central vault where computer programs and data are stored and gotten to by the customers in the network, while a Web Server is a PC program or a PC that runs the application.

What is the difference between servers and database?

A database refers to an application that provides the ability to store, backup, organize or modify digital files to a separate computing system. A server is a piece of hardware or software assigned to handle a specific type of computing function, such as connecting to multiple printers or hosting a website.

What is Web server and DB server?

Database server will have your one or more database hosted such as Oracle, Sql Server, MySql, etc. If you are referring to htdocs then it is a Web Server. The database you are using is must be installed on different server which is your Database server.


2 Answers

This often gets confusing.

Firstly - "Server" can refer to a physical thing (a computer), or a logical thing (a piece of software).

Web, application and database server software can all run on the same physical server machine, or be distributed across multiple physical machines. Most large websites have multiple machines; most "consumer" hosting packages run on a single box.

The logical separation is as follows.

The Web server deals with HTTP(S) requests, and passes these requests on to "handlers". They have built-in handlers for file requests - HTML pages, images, CSS, JavaScript etc. You can add additional handlers for requests that they cannot manage - e.g. dynamic pages delivered by the application server. Web servers implement the HTTP specification, and know how to manage request and response headers.

The application server handles requests which create dynamic pages. So instead of serving an HTML page that is stored on the hard drive, they dynamically generate the HTML sent to the end user. Common languages/frameworks for this are Java/JSP, .Net (aspx), PHP, Ruby (on Rails or not), Python etc. Most of the time, this application server software is running on the same physical server machine as the web server.

The database server software is where the application stores its structured information. Typically, this means custom software which allows the application server to ask questions like "how many items does user x have in their basket?", using a programming language. Examples are MySQL, SQL Server, Oracle (all "relational databases"), and MongoDB, Redis and CouchDB ("NoSQL" solutions).

The database software can run on the same physical machine as the web server, but it's usually the first thing that gets hosted on separate physical hardware when the site needs to scale.

like image 197
Neville Kuyt Avatar answered Oct 02 '22 13:10

Neville Kuyt


Web Server -

Server on which your website is hosted. This server will have installed web servers such as IIS, apache, etc.

Application Server -

Server on which your created applications which are utilizing your database, web service, etc. This application server will host business layer (wrapped with web services), scheduled jobs, windows services, etc.

Database Server -

Database server will have your one or more database hosted such as Oracle, Sql Server, MySql, etc.


If you are referring to htdocs then it is a Web Server. The database you are using is must be installed on different server which is your Database server. Application server can also be installed on the same web server machine.

enter image description here

Reference - Deployment Patterns

like image 35
Parag Meshram Avatar answered Oct 02 '22 12:10

Parag Meshram