Skip to content

What is an API gateway and when is it worth introducing one?

The single entry point for externally exposed APIs: authentication, rate limiting, versioning and CORS handled outside application code.

An API gateway is the software layer that sits between external clients (applications, partners, devices) and a system's APIs, governing access in a single place instead of inside every individual service. It centralizes functions that would otherwise be rewritten identically in every endpoint: authentication and authorization, rate limiting to stop a client from overwhelming the backend, versioning to let old and new clients coexist on the same API, CORS handling for browser clients, and routing to the correct service. It governs north-south traffic, the traffic entering from outside the system, and has to be kept distinct from a service mesh, which governs east-west traffic between internal services: two layers of the same architecture, frequently mixed up in the same conversation because they share some functions (routing, retries) while each one solves a genuinely different problem.

See also: Service meshAn infrastructure layer that handles routing, encryption and retries between microservices, outside application code.

What it consolidates, and why it is the anti-fragmentation choice

Without a gateway, every service exposing a public API ends up implementing its own version of authentication, its own rate limits and its own CORS policy, with the result that the same security rule lives in ten different places and drifts inconsistently whenever someone updates only one of them. The gateway moves those responsibilities into a single layer that gets configured and updated once, and it often adds two functions a load balancer alone does not offer: transformation of request and response to adapt heterogeneous formats between client and backend, and aggregation of several calls to different services into a single client response, plus circuit breaking toward upstream services when one of them degrades. The mirror-image cost is a single control point that, if undersized or misconfigured, becomes a bottleneck for all inbound traffic, and if not made redundant a single point of failure for the whole exposed system: the operational discipline of high availability that applies to a database or a load balancer applies the same way to the gateway, it is not optional just because it sits higher in the stack. Factor in also the extra network hop the gateway adds to every call, a fixed latency cost and not just a risk when traffic grows.

An enterprise example

A company exposing its APIs to three different channels (a mobile app, a B2B partner portal, enterprise customer integrations) needs to apply different rate limits per channel, without touching the code of the services those APIs implement: the partner portal has to sustain a predictable volume agreed by contract, while enterprise integrations can have unpredictable spikes that need queuing rather than an error. With a gateway, this policy is written in a single configuration point and applied before the request reaches the service. Without one, every team that owns a service has to implement and maintain its own version of the same logic, with the real risk that two teams implement it differently and produce inconsistent behavior for the same customer across different APIs.

Why it matters for decision makers

The question to ask before introducing a gateway is not whether an entry point is needed, almost any system with more than one exposed service benefits from one, but how much of the edge logic (authentication, limits, versioning) is duplicated today and how much it costs to keep it duplicated against the operational cost of a new layer to maintain. It also has to be kept distinct from an AI gateway, which solves the same centralized-control problem but for traffic toward language models (keys, quotas, per-token costs, AI-specific security filters): a company that already has a generic API gateway has not automatically solved governance of traffic to models, because the two risk categories and the two metrics to control do not overlap.

  • Service meshAn infrastructure layer that handles routing, encryption and retries between microservices, outside application code.
  • API (Application Programming Interface)The contract two software systems use to exchange data and functions without knowing each other's code.
  • Platform engineeringPlatform engineering designs shared, reusable, self-service internal capabilities as a product, helping internal teams build and operate their own software.
  • ObservabilityObservability is the ability to understand a software system's internal behavior in production using the data it produces, such as logs, metrics, and traces.
  • EDIThe automatic exchange of structured business documents between the systems of two different companies.

See it in the universe

If it reminds you of a system nobody dares touch anymore, that is what I put back in order.

See Software Rescue

Or write to me.