life is too short for a diary




Understanding Webservers in Frameworks

Tags: web server

Author
Written by: Tushar Sharma

FastAPI and Uvicorn

FastAPI is a modern, asynchronous web framework for building APIs.
It requires an ASGI-compatible web server (like Uvicorn) to handle HTTP requests, since it doesn't include a server itself.
Uvicorn is a high-performance ASGI server that supports asynchronous I/O and is well-suited for FastAPI.
This contrasts with Django, which uses WSGI — a synchronous and blocking interface — making FastAPI more performant and scalable for concurrent workloads.

Django and WSGI

Django includes a built-in development server based on WSGI (Web Server Gateway Interface), which is synchronous and blocking.
This server is suitable for development but not recommended for production.
For production, Django apps are typically served with servers like Gunicorn or uWSGI, often behind a reverse proxy like Nginx.

Spring Boot

Spring Boot is a Java framework that includes an embedded web server by default, simplifying deployment:

This flexibility allows Spring Boot to support both blocking (traditional) and reactive programming models.

Angular

Angular is a frontend framework for building single-page applications (SPAs).
It does not include a backend server; instead, it runs in the browser and communicates with backend APIs over HTTP.
During development, Angular uses a development server (ng serve) powered by Webpack Dev Server to serve the frontend assets and enable live reload.
In production, Angular apps are compiled into static files (HTML, JS, CSS) and served by any static file server or CDN.

NestJS

NestJS is a Node.js backend framework built with TypeScript and inspired by Angular’s architecture.
It supports multiple underlying HTTP servers:


comments powered by Disqus