Home/Glossary/API Gateway

API Gateway

A service that acts as a single entry point for API requests, handling routing, authentication, rate limiting, and other cross-cutting concerns.

Cloud InfrastructureAlso called: "api management", "api proxy", "api router"

API gateways centralize management of API traffic, reducing complexity for backend services and providing consistent security and observability.

Why it matters

  • Eliminates duplicate authentication and authorization logic across services.
  • Provides a single point for rate limiting, preventing abuse and ensuring fair usage.
  • Enables traffic management, including load balancing and A/B testing.
  • Simplifies client integration by aggregating multiple backend services.
  • Essential for microservices architectures where dozens of services need unified access control.

Key capabilities

  • Request routing: Direct traffic to appropriate backend services based on path, headers, or content.
  • Authentication: Validate API keys, OAuth tokens, JWTs, or mutual TLS certificates.
  • Rate limiting: Protect backends from traffic spikes and enforce usage quotas.
  • Request transformation: Modify headers, query parameters, or body content.
  • Response caching: Reduce backend load for frequently requested data.
  • Logging and analytics: Centralized visibility into API usage and performance.

Common patterns

  • Edge gateway: Single entry point for external API traffic at the network perimeter.
  • Internal gateway: Manages service-to-service communication within a cluster.
  • Backend for Frontend (BFF): Specialized gateways optimized for specific client types (mobile, web, IoT).

Security best practices

  • Terminate TLS at the gateway and use mutual TLS for backend connections.
  • Implement OAuth 2.0 or OpenID Connect for token-based authentication.
  • Apply rate limiting and throttling to prevent denial-of-service attacks.
  • Validate and sanitize all incoming requests to prevent injection attacks.
  • Log all requests for security auditing and incident investigation.

Popular implementations

  • Cloud-native: AWS API Gateway, Azure API Management, Google Cloud API Gateway.
  • Open source: Kong, Tyk, KrakenD.
  • Service mesh: Istio Ingress Gateway, Envoy.