What is an API gateway in microservices?

Answer

An API gateway is a server that acts as the single entry point for all client requests to a microservices system. Instead of clients calling dozens of backend services directly, they call the gateway, which routes requests to the appropriate service, aggregates responses, handles authentication and authorization, enforces rate limiting, and provides SSL termination. Popular API gateways include Kong, AWS API Gateway, NGINX, and Netflix Zuul. The API gateway pattern reduces client complexity, centralizes cross-cutting concerns, and shields internal service topology from external clients. The tradeoff is that it can become a bottleneck and a single point of failure if not deployed carefully.