Web Development – Application Server & Web Server (Quick Notes)

Application Server vs Web Server

Application server is the superset of Web server.
The main difference between Web server and Application server is that web server is meant to serve Static content e.g. HTML and CSS, while Application Server is responsible for generating Dynamic content by executing server-side/back-end code.

A Web server is designed to handle HTTP requests and responses, and is responsible for serving static content (such as HTML pages) to client-devices over the internet. A web server does not execute application code, but rather serves as a channel for requests and responses between the client and the application.

An Application server, on the other hand, is a type of server that is designed to host and run applications. An application server provides an environment for executing applications and includes features such as a runtime environment, a database connection pool, and support for various protocols and APIs.

Dynamic content

Dynamic content refers to website content that changes based on user input or other factors. This can include things like personalised recommendations or customised displays based on the user’s location or browsing history. Dynamic content is often generated by making API (Application Programming Interface) calls to the back-end, rather than being a static part of the website’s HTML code. Dynamic content can make websites more interactive and engaging for users, as it provides a more personalised and customized experience.

Static content

Static content refers to website content that does not change. It is a part of the website’s HTML and CSS code, rather than being generated dynamically in response to user input or other factors. Static content can include things like static text, media etc that are part of the website’s design and layout. It is called “static” because it does not change unless its content is updated by changing HTML & CSS code of the website.

Why do we need a Web server along with an Application server?

It can be useful to have a web server because:

  1. Performance: A web server is designed to handle static content and can serve it much more quickly than an application server. By using a web server in front of the application server, static content can be served more efficiently, improving the overall performance of the website.
  2. Virtual Hosts: You can give the appearance of many different hosts all operating on the same IP address. You can create Virtual-Hosts on your main server that will accept requests from designated servers and route them to the correct ports. These Virtual-Hosts can be defined in the configuration file.
  3. Security: A web server can act as a first line of defense, protecting the application server from certain types of attacks. For example, a web server can be configured to block certain types of requests or to filter out malicious traffic before it reaches the application server.
  4. Scalability: A web server can be horizontally scaled, meaning that it can handle more traffic by adding more instances of the server. This can be useful in situations where the website experiences a sudden increase in traffic.
  5. Load balancer: Perhaps the single greatest use of a web server is the ability to load balance traffic in a cluster. Web server makes this easy to achieve. Load balancing allows web servers to act as your bouncer, dividing traffic evenly among all members of your cluster.

Leave a Reply

Your email address will not be published. Required fields are marked *