ArchitectureIntermediate

Service Mesh vs API Gateway: A Decision Framework

DeveloperHat Team
12 min read

TL;DR

API gateways guard north-south traffic; service meshes govern east-west traffic. When to run one, both, or neither — and what changed in 2025–26.

Service mesh vs API gateway is a question with a short answer and a long tail. The short answer: they solve different problems. An API gateway is the front door — it manages traffic coming into your system from outside. A service mesh is the internal network — it manages traffic between services already inside. Most production Kubernetes stacks end up running both, and picking the wrong one first creates cleanup work you do not want.

The short version: if external clients call your APIs, you need a gateway. If your services call each other across trust boundaries and you need that traffic encrypted, retried, and observed without touching application code, you need a mesh. If you have neither problem yet, you need neither — a plain Ingress and your framework's HTTP client will do. The rest of this article is the framework for deciding which of those sentences describes your system.

Clients external API Gateway auth · rate limits CLUSTER · SERVICE MESH orders service A inventory service B pricing service C One front door, one internal network The gateway handles north-south traffic; the mesh handles east-west. mTLS on every hop — identity, not IP The gateway decides who may call. The mesh decides how services talk — encrypted, retried, observed.

What each one actually does

An API gateway sits at the edge and is the single entry point for external traffic. It authenticates callers (OAuth 2.0, OIDC, JWT, API keys), enforces rate limits and quotas, routes requests to the right backend service, and often transforms requests or aggregates responses from several services into one answer. It is where business logic about who the consumer is lives: which plan they are on, whether they are authorized for this endpoint, whether they have exceeded their quota. Common choices include Kong, NGINX, Traefik, Envoy Gateway, AWS API Gateway, and Azure API Management. If you expose a public or partner API, the gateway is the enforcement point for anyone calling it from outside the cluster.

A service mesh is infrastructure for service-to-service communication inside the cluster. A control plane (Istio's istiod, for example) programs a data plane of proxies that sit next to — or, in newer designs, underneath — your workloads. The mesh gives you mutual TLS between services with cryptographic workload identity, retries and timeouts, traffic shifting for canary releases, and consistent metrics and traces for every hop, all without changing application code. The leading implementations are Istio, Linkerd, and Cilium, with Consul still present in multi-cloud and VM-heavy estates. The mesh carries transport concerns: is the pod-to-pod call encrypted, did it succeed, should it be retried.

The overlap is real but narrow. Both do load balancing, both emit telemetry, both can do routing. The difference is the traffic they see and the questions they answer. The gateway never sees the internal calls between orders, inventory, and pricing. The mesh never sees the external mobile client. That split is the whole decision.

The options

Option 1: API gateway only

A gateway at the edge, services behind it talking to each other directly — plain Kubernetes Services, your framework's HTTP client, retries coded in the application. This is the right shape for most teams that expose an API but run a modest number of services.

Pick this when you have external consumers, a handful of internal services (roughly under ten), and no compliance requirement forcing encryption between your own services. It is cheap to operate, the failure modes are familiar, and you can add a mesh later when the internal traffic justifies it. Our guide to AWS API Gateway patterns covers the managed-gateway end of this option in detail.

Option 2: Service mesh only

A mesh with no public-facing gateway — for platforms whose consumers are all internal: other teams' services, batch jobs, internal tools. The mesh secures and observes east-west traffic, and ingress is a plain Ingress resource or a Gateway API Gateway with no gateway product behind it.

Pick this when nothing external calls your APIs but internal traffic still crosses trust boundaries — multi-tenant services, regulated data moving between teams, or a platform whose tenants are other internal teams. It is a rarer shape than vendors imply: most systems that are complex enough to need a mesh also have at least one external consumer.

Option 3: Both — the gateway in front, the mesh inside

The gateway terminates external traffic, authenticates the caller, and hands the request to a service inside the mesh. From there the mesh takes over: mTLS between services, retries, canary shifts, per-hop telemetry. This is the standard production shape for a public API backed by microservices, and it is what most of the "which one?" debate eventually resolves to.

Pick this when you have both a public API and a service estate large enough that service-to-service traffic needs governing — typically dozens of services, multiple teams, and a platform owner who can run the mesh. The two layers compose cleanly because they answer different questions.

Option 4: Neither

Plain Ingress (or a Gateway API Gateway) for routing, no gateway product, no mesh. Services call each other over Kubernetes Services with whatever retry logic lives in the application.

Pick this when you are small, internal-only, or still finding product-market fit. A mesh is a platform product: it needs an owner, upgrades, and on-call coverage for its control plane. Installing one to solve a problem you do not have yet is the infrastructure version of premature optimization. Start here, and let the decision framework below tell you when to move.

The comparison

ConcernAPI GatewayService Mesh
Traffic directionNorth-south (client → service)East-west (service → service)
Primary consumerExternal developers, partners, appsInternal services
Auth modelOAuth, JWT, API keys, OIDCmTLS, SPIFFE workload identity
Deployed asEdge proxy (centralized or distributed)Sidecar per pod, or per-node proxy in ambient mode
What it ownsWho may call, quotas, request shapingEncryption, retries, traffic shifting, per-hop telemetry
Ops burdenLow–medium: one component to runMedium–high: control plane + data plane across every pod
When it pays offThe day you expose an APIWhen internal traffic outgrows in-app handling

What changed in 2025–2026

Three changes moved the decision in the last two years, and any framework written before them is out of date.

Ambient mode made Istio cheaper to adopt. Istio's ambient mode reached general availability in Istio 1.24, announced 7 November 2024: a per-node ztunnel proxy handles L4 mTLS and authorization, with optional waypoint proxies adding L7 features only where you need them. No sidecar is injected into your pods, and enrolling a namespace no longer requires restarting its workloads. Sidecars are not going away — they remain first-class in Istio — but the cost of starting a mesh is now much lower than it was. Current releases are in the Istio 1.31 line as of late 2026.

Native sidecars fixed the oldest sidecar complaint. Kubernetes native sidecar containers — init containers with restartPolicy: Always — went stable in Kubernetes 1.33 (April 2025). They start before application containers, keep running for the pod's lifetime, and stop after it, which fixes the startup-ordering and Job-termination bugs that made classic sidecars painful. Istio 1.27 made native sidecars the default for eligible pods, and Linkerd 2.20 did the same for its proxy injection. Native sidecars fix lifecycle, not cost: there is still one proxy per pod.

Gateway API became the shared language. The Kubernetes Gateway API went GA with v1.0 on 31 October 2023, graduating GatewayClass, Gateway, and HTTPRoute to stable, and the spec has since iterated to v1.6 (October 2026). It is the successor to the Ingress API: a typed, role-oriented model (infrastructure team owns the Gateway, application teams own their HTTPRoutes) that works the same across implementations — Istio, Envoy Gateway, Cilium, NGINX, Kong, and Traefik all speak it. The GAMMA initiative extends the same API into east-west mesh traffic, which is why the line between "gateway" and "mesh" keeps blurring: increasingly, the difference is which Gateway API implementation you run and where you point it, not a different product category. Istio 1.31 even lets you run agentgateway — a proxy built for AI-agent and MCP traffic — as a waypoint, which is the same convergence showing up for agent traffic.

One vendor exit to note. AWS discontinued support for AWS App Mesh on 30 September 2026; the AWS documentation points existing customers at Amazon ECS Service Connect or VPC Lattice instead. If you are still on App Mesh, the mesh decision is no longer hypothetical — it is a migration.

Trade-offs

The trade-off nobody puts in the demo is operational ownership. A gateway is one component at the edge; a mesh is a control plane plus a data plane touching every pod in the cluster. Upgrades, certificate rotation, proxy version skew, and debugging a request that crossed five proxies are all yours. A mesh without a named owner becomes the thing everyone depends on and nobody maintains. Do not adopt one until someone's job description includes it.

The second trade-off is the per-hop tax. Every proxy in the path adds latency and resource consumption. Ambient mode and eBPF designs (Cilium) reduce the tax, but they do not remove it — there is still a proxy or a kernel program on the path. Measure p99 latency with the mesh on and off in staging before you commit; do not trust a vendor's benchmark, which was measured on their workload, not yours. If your services are latency-sensitive and chatty, the mesh's retry and observability benefits have to outweigh a tax you pay on every single call.

The third trade-off is debugging distance. When a request fails inside a mesh, the failure can live in the application, the sidecar, the waypoint, the control plane's configuration, or the interaction between them — and the error the client sees rarely says which. Your team needs to be comfortable reading Envoy access logs and istioctl output. A gateway's failure modes are simpler because there is exactly one hop to inspect.

And the trade-off teams forget: a mesh encodes your current service boundaries, including the bad ones. If two services chat constantly because the boundary between them is wrong, the mesh will make that chatter encrypted, retried, and beautifully traced — and still slow. Fix the boundary before you govern the traffic across it.

Recommendation — the decision framework

Answer these five questions in order. The first "yes" that fires tells you what to run.

  • Do external clients call your APIs? Yes → you need a gateway. No gateway product is required if a plain Ingress or Gateway API Gateway covers your routing, but the moment you need per-consumer auth, quotas, or a developer portal, buy or run a gateway. This is the only question most teams need to answer first.
  • Do your services call each other across trust boundaries? Yes → you need encrypted, identity-based east-west traffic. That usually means a mesh (or, at minimum, mTLS via your platform's own mechanism), not a gateway — a gateway never sees this traffic.
  • How many services, and how many teams? Under ~10 services and one team: a mesh is overhead; in-app retries and plain Services are enough. Dozens of services and several teams: the mesh's consistent retries, canary shifts, and per-hop telemetry start paying for themselves, because no single team can keep the whole call graph in its head.
  • Who owns the platform? No named owner and no on-call rotation for it → do not run a mesh. A gateway is forgiving of thin ownership; a mesh is not. This question vetoes the mesh even when question 3 says yes.
  • Is there a compliance or security driver for encrypted internal traffic? Regulated data, multi-tenant services, or a zero-trust mandate → the mesh (or ambient mode, which is the cheapest way to get mTLS everywhere) becomes the answer even at modest scale, because it is the only option that encrypts traffic you did not write code for.
  • If the answers point to both a gateway and a mesh, run both — gateway at the edge, mesh inside — and let Gateway API be the configuration language for the edge. If they point to neither, run neither and revisit the questions every six months or every time the service count doubles.

    When not to run a mesh

    Do not run a mesh for a monolith, or for a handful of services owned by one team. Do not run one because a conference talk made it sound standard — the teams running Istio in production have platform teams, and the talk rarely mentions them. Do not run one when your services already communicate reliably and your real problem is a bad service boundary, flaky downstream, or missing timeouts in application code; a mesh will instrument those problems, not fix them.

    Do not buy a gateway when you have no external consumers. An internal-only platform with a plain Ingress does not need per-consumer quotas or a developer portal, and a gateway product is a component to operate for no benefit. And do not confuse the two: a gateway does not secure service-to-service traffic, and a mesh does not authenticate your external API consumers. Buying one to do the other's job is the most common — and most expensive — version of this mistake.

    What to do next

    This week, draw your traffic on one page: external callers on the left, services on the right, arrows for every hop. If every arrow starts outside, you need a gateway. If the arrows between your own services cross team or trust boundaries, price a mesh — starting with ambient mode, which is the cheapest way to get mTLS everywhere — and check whether you have a named owner for it before you install anything. If the picture is simple, leave it simple: the best infrastructure decision this quarter might be the one you do not make. For the implementation detail once you have decided, start with our guide to service mesh architecture — and if your services run on Kubernetes, our Kubernetes architecture explainer covers the platform underneath both choices.

    Why This Matters

    Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

    Trade-offs to Consider

    Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

    When NOT to Use This

    Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

    Decision Framework

    Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

    Share this articleShare on XShare on LinkedIn

    Keep the decision frameworks coming

    One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.