In a microservices architecture, what is an 'API Gateway' and what cross-cutting concerns does it typically handle?
- A.An API gateway is a DNS server that routes requests to microservices based on hostname
- B.An API gateway is a database proxy that routes SQL queries to the correct database shard
- C.An API gateway is a single entry point for all client requests that handles cross-cutting concerns: authentication/authorization, rate limiting, request routing, SSL termination, request/response transformation, logging, caching, and API versioning - delegating business logic to individual microservices
- D.An API gateway is only used for mobile apps; web apps communicate directly with microservices
Why C is correct
An API gateway centralizes concerns that would otherwise be duplicated across every microservice. By handling auth, rate limiting, logging, and TLS at the gateway, each microservice only needs to implement its business logic. Examples: Kong, AWS API Gateway, Nginx with Lua, Envoy. Security benefit: a central enforcement point ensures no microservice is accidentally exposed without auth. Trade-off: the gateway is a single point of failure and must be highly available.
Know someone studying for Web App Fundamentals? Send them this one.