What is the difference between a web server and a web framework?
20th January 2012
My answer to What is the difference between a web server and a web framework? on Quora
A “web framework” offers a set of APIs for writing your own custom code in such a way that it can be called via the Web. Usually a framework will deal with common details such as HTTP header parsing, URL routing and so forth.
A web server is a piece of software which listens on a network port for incoming HTTP requests and responds to them. Most web servers have a default mode where they will interpret the incoming request as a path on the filesystem and return the file at that path, but they can usually be configured to do something else with the request instead (pass it to a CGI script, proxy it to another server, run some custom module code etc).
If you squint at Apache or nginx (commonly referred to as web servers) you might be able to describe them as web frameworks as well, since both offer extensive configuration options and a C module API for writing custom code. Most people won’t call them that though.
Likewise, if you consider node.js to be a framework (which I think is a reasonable interpretation, but others may disagree with me) you could also consider it a web server, since it comes with a reasonably robust HTTP server implementation that can be started using a single function call.
The problem here is really that the concept of a “web framework” doesn’t lend itself to a rock-tight definition.
I imagine this answer is more confusing than it is helpful, for which I apologise.
More recent articles
- Highlights from my appearance on the Data Renegades podcast with CL Kao and Dori Wilson - 26th November 2025
- Claude Opus 4.5, and why evaluating new LLMs is increasingly difficult - 24th November 2025
- sqlite-utils 4.0a1 has several (minor) backwards incompatible changes - 24th November 2025