Web Server
- A web server is a software component that delivers static data like images, files, and text in response to client requests.
- When you enter the URL, the URLis actually of a Web Server
- Protocols: HTTP, FTP (files), SMTP (email)
- They deliver mostly static data
- Generally are not multi-threaded, use non-blocking I/O and callbacks
- Are we talking about Nodejs?
Application Server
- An application server adds business logic to compute the web server’s response.
- The request to web server is transferred to the application server
- Protocols: web server protocols + protocols such as RPC, variants of CGI
- They deliver dynamic data such as personalized UIs, database results, processed HTML, dynamic reports etc.
- They are multithreaded
Notes
- The above are just common understanding since there is no exact definition describing the two
- The server can act as both Web Server as well as App Server for example:
- Apache HTTP Server
- Nodejs: Express, Hapi, Koa (Do we need to separate out static parts and dynamic parts)
- Django: recommends in production server:
- serve static website parts with web server like Nginx or CDN. serving static parts with Django will introduce latency
- dynamic part with app server like gunicorn
- request —> Nginx (web server) —> Gunicorn (app server)
- ref: