Middleware handles cross-cutting request concerns without mixing them into services.
- Request IDs
- Authentication and authorization
- Idempotency checks
- Logging context
- Feature flags
- Metrics
Middleware should enrich or reject context. Business behavior belongs in services and facades.