The API Gateway Pattern
External clients should not need to know about every internal microservice. An API Gateway sits at the edge as a single entry point — routing /users to the User Service, /orders to the Order Service, and /payments to the Payment Service. It centralizes cross-cutting concerns: authentication, rate limiting, request logging, SSL termination, and response aggregation. Without a gateway, clients hold URLs for five services, each with its own auth mechanism and error format. With a gateway, clients talk to one host and one API contract. The gateway can also implement the Backend for Frontend (BFF) pattern — exposing different aggregated endpoints for mobile vs web clients.