Skip to main content

API Management

APIs are the main way systems, partners and increasingly AI agents access an organization's capabilities. As the number of APIs grows, they need to be designed consistently, secured, observed, versioned and discoverable. API management is the platform capability that provides this.

Two architectural building blocks carry most of the runtime responsibility:

  • API gateways handle traffic entering the platform from clients and partners (north–south traffic).
  • Service meshes handle traffic between services inside the platform (east–west traffic).

The API lifecycle​

API management covers the whole lifecycle of an API, not only its runtime:

StagePractices
DesignAPI-first design with OpenAPI; consistent style guidelines; resources based on the enterprise data model
Review and validationAutomated linting of API definitions against the guidelines, for example with Spectral; design reviews for public APIs
PublishRegister the API in a catalog or developer portal with documentation, examples and owner, for example as an API entity in Backstage
SecureAuthentication and authorization (OAuth 2.0 / OIDC tokens, API keys for simple cases), see identity and access management
OperateRate limits, quotas, monitoring, alerting and usage analytics
Version and evolveBackward-compatible changes by default; new versions for breaking changes, with migration periods
Deprecate and retireAnnounce deprecation, track remaining consumers, remove when usage has stopped

APIs, like events, are contracts. The same governance principles apply to both, including the distinction between public, cross-domain contracts and private interfaces within a system boundary (see event-driven architecture). The OWASP API Security Top 10 lists the most common API security risks, such as broken object-level authorization.

API gateways​

An API gateway is a single entry point in front of a set of backend services. Clients talk to the gateway; the gateway routes requests to the right service and applies cross-cutting policies consistently, so each service does not have to implement them. See the API gateway pattern.

Responsibilities​

FunctionDescription
RoutingMaps public paths and hosts to backend services and versions
Authentication and authorizationValidates tokens or API keys, checks scopes, rejects unauthorized requests before they reach services
Rate limiting and quotasProtects backends from overload and enforces usage plans per client or partner
Request validationRejects requests that do not match the API definition
TransformationAdapts headers, payloads or protocols, for example REST to gRPC
CachingServes repeated responses without calling the backend
TLS terminationHandles certificates and encryption at the edge
ObservabilityAccess logs, metrics and traces for every request (see observability)
Monetization and analyticsUsage reporting and billing for external API products

Gateway patterns​

PatternDescriptionWhen to use
Edge gatewayOne gateway for all external trafficMost organizations, as the default entry point
Backends for frontends (BFF)A separate gateway or API layer per client type (web, mobile, partner), shaped for that client's needs (pattern by Sam Newman)Clients with very different needs; avoids one API that fits nobody
Domain gatewaysOne gateway per domain, owned by the domain teamLarge organizations with autonomous domains
Internal gatewayA gateway for traffic between domains or business units inside the organizationWhen internal APIs need the same governance as external ones

Gateways should stay thin. Business logic and orchestration belong in services; a gateway that accumulates logic becomes a bottleneck and a single point of failure for change.

Implementations​

CategoryExamples
Cloud provider gateways and API managementAmazon API Gateway, Azure API Management, Google Apigee, Google Cloud API Gateway
Open source and commercial gatewaysKong, Tyk, Apache APISIX, KrakenD, Gravitee
Integration platforms with API managementMuleSoft Anypoint API Manager
Kubernetes-nativeKubernetes Gateway API as the standard configuration model, implemented for example by Envoy Gateway on top of the Envoy proxy

Full API management platforms (Apigee, Azure API Management, Kong, Tyk, Gravitee, MuleSoft) add a developer portal, API catalog, lifecycle management and analytics on top of the gateway runtime.

note

Many gateway products now also offer AI gateway features for LLM traffic: routing between model providers, token-based rate limits and cost tracking. A dedicated LLM gateway such as LiteLLM is shown in the agents reference architecture.

Service mesh​

With dozens or hundreds of services calling each other, every service would need to implement the same networking concerns: finding other services, encrypting traffic, retrying failed calls, collecting metrics. A service mesh moves these concerns out of application code into the platform.

How it works​

A service mesh has two parts:

  • Data plane: proxies that handle all traffic between services. Traditionally a sidecar proxy (often Envoy) runs next to every service instance. Newer designs reduce the overhead with node-level proxies, such as Istio's ambient mode, or with eBPF in the Linux kernel, as in Cilium.
  • Control plane: configures the proxies centrally: routing rules, security policies, certificates and service discovery.

Concepts and capabilities​

CapabilityDescription
Service discoveryServices find each other by name instead of hard-coded addresses; the mesh keeps track of healthy instances
Load balancingRequests are spread across healthy instances, often with smarter algorithms than basic round-robin
Mutual TLS and service identityAll traffic between services is encrypted, and each service has a cryptographic identity (often following SPIFFE), enabling zero-trust networking
Authorization policiesRules on which services may call which, for example "only Orders may call Payment"
Traffic managementTimeouts, retries, circuit breaking, and traffic splitting for canary releases and A/B tests
ObservabilityConsistent metrics, logs and traces for all service-to-service calls, without code changes

Service discovery​

Discoverability is a basic need in any distributed system: services must find each other as instances start, stop and move. Service meshes provide it, but it also exists without a mesh:

ApproachHow it worksExamples
Platform DNSServices are reached by a stable name; the platform resolves it to healthy instancesKubernetes Services
Service registryInstances register themselves; clients or load balancers query the registry (pattern)HashiCorp Consul, AWS Cloud Map
Client-side discoveryThe client looks up instances and chooses one (pattern)Client libraries with a registry
Server-side discoveryThe client calls a load balancer or proxy that finds the instance (pattern)Load balancers, mesh proxies

Runtime discovery (where is the payment service right now?) is different from design-time discovery (which APIs exist and how do I use them?). The second is served by the API catalog and developer portal, and by the systems inventory.

Implementations​

MeshCharacteristics
IstioFeature-rich, widely used; sidecar or ambient (sidecar-less) mode; built on Envoy
LinkerdFocus on simplicity and low overhead; lightweight proxy written in Rust
ConsulService discovery and mesh across Kubernetes, virtual machines and multiple data centers
Cilium Service MesheBPF-based networking and mesh features, with optional proxies
Amazon VPC LatticeManaged AWS service for service-to-service connectivity, discovery and access policies across accounts and compute types

When a service mesh is worth it​

A mesh adds significant operational complexity. It pays off when there are many services with real needs for zero-trust security (mutual TLS everywhere, service-level authorization), consistent observability, or advanced traffic management. With a handful of services, platform DNS, a load balancer and good client libraries are often enough.

API gateway and service mesh compared​

API gatewayService mesh
TrafficNorth–south: clients and partners to servicesEast–west: service to service
FocusAPI products: authentication of external clients, quotas, developer experience, monetizationNetwork reliability and security between services
ConsumersExternal developers, partners, front ends, agentsInternal services
Typical featuresAPI keys and OAuth, rate limits, developer portal, transformationmTLS, service identity, retries, circuit breaking, traffic splitting
DeploymentAt the edge, or per domainAcross all services in the platform

Both are often used together: the gateway at the edge, the mesh inside. Some products cover both roles, and the boundary is blurring, but the two traffic types still have different requirements.

API management as a platform capability​

Following the platform mindset, teams should get API management as a ready-to-use capability:

  • Golden paths (provisioning) that create new services with an OpenAPI definition, gateway route, authentication and observability already configured.
  • Automated governance: API definitions linted in CI against the organization's guidelines; breaking changes detected before release.
  • One catalog of APIs and events, with owners, documentation and consumers, connected to the architecture repository.
  • Shared gateway and mesh operated by the platform team, configured by product teams through code (for example Gateway API resources), not through tickets.
  • Security by default: every API authenticated, every service-to-service call encrypted, and access policies managed as code.

Common pitfalls​

  • Gateway as a monolith: business logic, orchestration and transformations piling up in the gateway.
  • APIs without contracts: undocumented endpoints that consumers reverse-engineer, which then can never change.
  • No versioning strategy: breaking changes deployed without notice, or dozens of versions that are never retired.
  • Service mesh by default: adopting a mesh for a few services and taking on its operational cost without a real need.
  • Two catalogs or none: APIs documented in one place, events in another, and neither linked to owners and systems.