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
- Weeknotes: Llama 3, AI for Data Journalism, llm-evals and datasette-secrets - 23rd April 2024
- Options for accessing Llama 3 from the terminal using LLM - 22nd April 2024
- AI for Data Journalism: demonstrating what we can do with this stuff right now - 17th April 2024
- Three major LLM releases in 24 hours (plus weeknotes) - 10th April 2024
- Building files-to-prompt entirely using Claude 3 Opus - 8th April 2024
- Running OCR against PDFs and images directly in your browser - 30th March 2024
- llm cmd undo last git commit - a new plugin for LLM - 26th March 2024
- Building and testing C extensions for SQLite with ChatGPT Code Interpreter - 23rd March 2024
- Claude and ChatGPT for ad-hoc sidequests - 22nd March 2024
- Weeknotes: the aftermath of NICAR - 16th March 2024