Concept
API Gateway vs Backend for Frontend (BFF)
In a microservices architecture, a single client (like a mobile app or web app) needs data from multiple backend services (like Users API, Catalog API, Payments API). Connecting directly is slow and couples clients to internal IP addresses.
- API Gateway: A single entry point that handles general cross-cutting concerns (rate-limiting, security, SSL termination, global routing) for all clients.
- Backend for Frontend (BFF): A specific gateway custom-tailored to support one specific client interface (e.g. one BFF for the iOS app, one BFF for the web dashboard):