{"id":11618,"date":"2026-08-18T15:18:08","date_gmt":"2026-08-18T13:18:08","guid":{"rendered":"https:\/\/www.scaleuptech.com\/de\/?p=6198"},"modified":"2026-08-18T15:42:48","modified_gmt":"2026-08-18T13:42:48","slug":"api-gateway-vs-service-mesh-vs-message-queue","status":"publish","type":"post","link":"https:\/\/www.scaleuptech.com\/en\/blog\/api-gateway-vs-service-mesh-vs-message-queue\/","title":{"rendered":"API gateway vs. service mesh vs. message queue - when do I use what?"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><em>Note: This post was first published in March 2020 and has since been thoroughly revised to incorporate recent developments such as the Kubernetes Gateway API and eBPF-based service meshes.<\/em>obtain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Microservices solve one problem, but they also create a new one: Once the monolithic application has been broken down into many small services, it must be determined how these services communicate with each other and with the outside world. Anyone making this decision for their cluster will almost inevitably end up with three components: an API gateway, a service mesh, and a message queue. In most cases, however, it\u2019s not an either-or decision. Many DevOps teams use a combination of these approaches\u2014for example, an API gateway for incoming traffic from outside, a service mesh for communication between services, and a message queue for asynchronous tasks. This article categorizes the three concepts, highlights their overlaps, and provides guidance on when to use each component.<\/p>\n\n\n\n<h3 class=\"wp-block-heading p1\"><strong>What is actually the problem?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a brief analysis of the problem: For microservices to function as a distributed system, they must overcome a long list of challenges.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Elasticity<\/strong><br>There can be dozens or even hundreds of instances of a particular microservice, any of which can fail at any given time\u2014for example, due to a node restart, an out-of-memory error, or a failed deployment. A system that doesn\u2019t account for this will bring down the entire request with every single failure. Elasticity means: The failed payment service pod simply disappears from the list of responsive instances, and a new one takes over\u2014without the calling application even noticing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Load balancing and automatic scaling<\/strong><br>With potentially hundreds of endpoints capable of handling a request, routing and scaling are anything but trivial. It\u2019s not enough to simply distribute requests on a round-robin basis: An instance that is currently processing a computationally intensive request should receive new requests less frequently than one that is currently idle. More precise routing and scaling decisions\u2014such as those based on current load rather than a fixed distribution\u2014are among the most effective ways to control costs in large-scale architectures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Service detection<\/strong><br>The more distributed an application is, the harder it becomes to determine which instances of a service currently exist and are accessible\u2014pod IP addresses change with every restart. Service discovery solves this by having services register under a stable name (e.g.,. <code>payment service<\/code>) rather than under a fixed IP address, and a directory that continuously resolves this name to the currently active instances.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tracking and monitoring<\/strong><br>In a microservices architecture, a single user request can pass through multiple services\u2014for example, a purchase process might go through the auth service, payment service, inventory service, and notification service in succession. If something goes wrong anywhere in this chain, it is nearly impossible to determine which of the four services caused the problem without end-to-end tracing. Distributed tracing links all the steps of a request via a common trace ID, allowing the entire path to be reconstructed afterward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Versioning<\/strong><br>As systems grow, APIs must be further developed without breaking existing consumers\u2014another team that's still working against <code>\/api\/v1\/orders<\/code> work must not suddenly come to nothing just because, internally, it has long since <code>\/api\/v2\/orders<\/code> is in use. As a result, multiple API versions often need to be offered in parallel and phased out with a clear end date (deprecation), rather than rolling out breaking changes without warning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The solutions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we present the three key approaches to solving these problems: service meshes, API gateways (including their Kubernetes-native variant, the Gateway API), and message queues. Of course, there are also a number of other approaches that could be used, ranging from simple static load balancing via fixed IP addresses to central orchestration servers. In this post, however, we\u2019ll focus on the most popular and, in many respects, the most sophisticated options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading p1\"><strong>API Gateways<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><a href=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/api-gateway.png\"><img decoding=\"async\" src=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/api-gateway-1024x634.png\" alt=\"API Gateway\" class=\"wp-image-6209\"\/><\/a><figcaption class=\"wp-element-caption\">API Gateway - Graphic from arcentry.com<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">An API gateway is the big brother of the good old reverse proxy for HTTP calls. It is a scalable server, normally connected to the Internet, that can receive requests from both the public Internet and internal services and route them to the most appropriate microservice instance. API gateways provide a number of helpful features, including load balancing and integrity checks, API versioning and routing, request validation and authorization, data transformation, analysis, logging, SSL termination, and more. Examples of popular open source API gateways include. <a href=\"https:\/\/konghq.com\/kong\/\">Kong<\/a> or <a href=\"https:\/\/tyk.io\/\">Tyk<\/a>. Most cloud providers also offer their own implementation, such as AWS API Gateway, Azure API Management, or Google Cloud Endpoints.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The advantages<br><\/strong> API gateways offer powerful features, are comparatively low in complexity, and are easy for seasoned web veterans to understand. They provide solid protection against the public Internet and perform many repetitive tasks such as user authentication or data validation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The disadvantages<\/strong><br> API gateways are fairly centralized. They can be deployed in a horizontally scalable manner. However, unlike service meshes, new APIs have to be registered or the configuration changed at a central location. From an organizational perspective, they should therefore also only be managed by one team.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Kubernetes-native variant: Gateway API<\/strong><br>Running microservices on Kubernetes is now virtually impossible without using another feature: the Gateway API. It is the official successor to the classic Kubernetes Ingress object and addresses its biggest weakness: the reliance on controller-specific annotations. These annotations are not portable between different Ingress controllers. The core resources of the Gateway API\u2014GatewayClass, Gateway, HTTPRoute, GRPCRoute, TLSRoute, and ReferenceGrant\u2014have reached \u201eGeneral Availability\u201d (GA) status and are considered production-ready. Of particular note: The Ingress NGINX controller, which is used in many clusters, has been officially retired since March 2026. Several highly critical CVEs (including one with a CVSS score of 8.8) have already been published for the abandoned codebase, for which no further patches will be released. Anyone still running on classic Ingress should therefore plan to migrate to the Gateway API to avoid continuing to operate without security updates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading p1\"><strong>Service meshes<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><a href=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/service-mesh.png\"><img decoding=\"async\" src=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/service-mesh-1024x607.png\" alt=\"Service mesh\" class=\"wp-image-6211\"\/><\/a><figcaption class=\"wp-element-caption\">Service mesh - graphic by arcentry.com<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Service meshes are decentralized, self-organizing networks between microservice instances that handle load balancing, endpoint discovery, integrity checks, monitoring, and tracing. They operate by adding a small agent to each instance, called a \"sidecar.\" The service mesh mediates traffic and registration of instances, handles metrics collection and maintenance. While most service meshes are conceptually decentralized, they have one or more centralized elements to collect data or provide admin interfaces. Popular service mesh examples include Istio, Linkerd, or Hashicorp's Consul.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Advantages<\/strong><br> Service meshes are more dynamic and can easily change shape to accommodate new features and endpoints. Their decentralized nature makes it easier to work on microservices in isolated teams.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disadvantages<\/strong><br> Service meshes are based on many moving parts and can therefore become very complex very quickly. For example, fully leveraging Istio requires deploying a separate traffic manager, telemetry collector, certificate manager, and sidecar process for each node. They are also a relatively recent development for something that should form the backbone of your IT architecture.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Next Step: Sidecar-Free Meshes<\/strong><br>The main criticism of the classic sidecar model\u2014an additional proxy process per pod that consumes resources and increases latency (see comparison table)\u2014is now addressed by eBPF-based approaches. eBPF (extended Berkeley Packet Filter) allows network logic to be executed directly in the Linux kernel instead of running it in a separate sidecar process per pod. Cilium Service Mesh uses this for a sidecar-less approach at the node level. Istio itself also offers, with <strong>Ambient Mesh<\/strong> now supports an operating mode that does not require a sidecar per pod. For new clusters, the following approach is therefore increasingly recommended: Use Cilium as the CNI (Container Network Interface), test its native mesh capabilities with Hubble for observability\u2014and only add a separate mesh layer like Istio if additional needs arise, rather than assuming it\u2019s required from the outset.<\/p>\n\n\n\n<h3 class=\"wp-block-heading p1\"><strong>Message queues<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><a href=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/message-queue.png\"><img decoding=\"async\" src=\"https:\/\/www.scaleuptech.com\/de\/wp-content\/uploads\/2020\/03\/message-queue-1024x649.png\" alt=\"Message Queue\" class=\"wp-image-6210\"\/><\/a><figcaption class=\"wp-element-caption\">Message Queue - Graphic from arcentry.com<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">At first glance, comparing service meshes to a message queue seems like comparing apples to oranges: They are completely different things, but they solve the same problem, albeit in very different ways.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With a message queue, you can establish complex communication patterns between services by decoupling senders and receivers. You accomplish this using a number of measures, such as topic-based routing or publish-subscribe messaging, as well as buffered processing, which makes it easier for multiple instances to handle different aspects of a task over time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Message queues have been around for ages, resulting in a wide range of options: Popular open-source alternatives include Apache Kafka, AMQP brokers such as RabbitMQ, and Apache ActiveMQ Artemis. However, they are also provided by the respective cloud providers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Advantages<\/strong><br> Simply decoupling senders and receivers is an effective concept that eliminates the need for a number of other concepts such as integrity checks, routing, endpoint detection, or load balancing. Instances can select relevant tasks from a buffered queue as soon as they are ready. This is particularly effective when automatic orchestration and scaling decisions are based on the number of messages in each queue, resulting in resource-efficient systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disadvantages<\/strong><br> Message queues are not good at request \/ response communication. Some allow you to match this to existing concepts, but it is not really what they are made for. Because of their buffering, they can also add significant latency to a system. They are also quite centralized (although horizontally scalable) and can be quite expensive on a large scale.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Comparison Table<\/h4>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Criterion<\/strong><\/td><td><strong>API Gateway<\/strong><\/td><td><strong>Service mesh<\/strong><\/td><td><strong>Message Queue<\/strong><\/td><\/tr><tr><td>Traffic Direction<\/td><td>external \u2192 internal<\/td><td>Service-to-Service<\/td><td>Asynchronous, decoupled<\/td><\/tr><tr><td>Architecture<\/td><td>Central Reverse Proxy<\/td><td>Decentralized, one sidecar per instance<\/td><td>Central Broker<\/td><\/tr><tr><td>Typical Applications<\/td><td>Securing &amp; Routing Public APIs<\/td><td>Monitoring &amp; Managing Internal Communication<\/td><td>Process Tasks on a Delayed Basis<\/td><\/tr><tr><td>Operating Expenses<\/td><td>Medium<\/td><td>High<\/td><td>Low \u2013 medium<\/td><\/tr><tr><td>Scaling<\/td><td>Horizontal, centrally managed<\/td><td>Self-organizing<\/td><td>Horizontal (which can be expensive on a large scale)<\/td><\/tr><tr><td>Suitable for request\/response<\/td><td>Yes<\/td><td>Yes<\/td><td>No (Buffering\/Latency)<\/td><\/tr><tr><td>Latency<\/td><td>An extra hop (Edge)<\/td><td>Additional hop per call (sidecar), reduced with Ambient Mesh<\/td><td>Higher thanks to buffering, but decoupled<\/td><\/tr><tr><td>Security \/ mTLS<\/td><td>TLS Termination, Authentication\/Authorization at the Edge<\/td><td>mTLS is often built in natively between services (internal Zero Trust)<\/td><td>Transport Encryption, Access Control at the Broker Level<\/td><\/tr><tr><td>Sample Tools<\/td><td>Kong, Tyk, Gateway API, AWS API Gateway<\/td><td>Istio, Linkerd, Consul, Cilium<\/td><td>Kafka, RabbitMQ, SQS, Pub\/Sub<\/td><\/tr><tr><td>Team Model<\/td><td>A central team<\/td><td>One isolated team per service is possible<\/td><td>Centrally managed<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With classic sidecar mesh (Istio with Envoy sidecar), the following occur: <strong>two additional hops<\/strong> per call (sending a sidecar + receiving a sidecar), not just one. With Ambient Mesh, this is partially eliminated due to the split node-proxy architecture.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>So, when should you choose which solution?<\/strong><br> Actually, this is not necessarily an either-or decision. In fact, it may make perfect sense to provide the publicly available API with an API gateway, run a service mesh for inter-service communication, and support things with a message queue for asynchronous task scheduling. A service mesh can work with an API gateway to efficiently accept external traffic and then effectively forward that traffic once it is on the network. The combination of these technologies can be a powerful way to ensure application availability and resiliency while ensuring that your applications can be used with ease.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In a deployment with an API gateway and a service mesh, incoming traffic from outside the cluster is routed first through the API gateway and then into the mesh. The API gateway can handle authentication, edge routing, and other edge functions, while the service mesh provides detailed observation and control of your architecture.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, if you want to focus only on communication between services, one possible answer could be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you are already running an API gateway for your public-facing API, you can keep the complexity just as low and reuse it for communication between services.<\/li>\n\n\n\n<li>If you work in a large organization with isolated teams and poor communication, a service mesh gives you maximum independence so you can easily add new services over time.<\/li>\n\n\n\n<li>If you are designing a system where individual steps are spread out over time, such as a YouTube-like service where uploading, processing, and publishing videos can take a few minutes, use a message or task queue to do this.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">What the future holds<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The 2020 forecast in this article has since come true: API gateways and service meshes have converged more closely than was foreseeable at the time\u2014the Kubernetes Gateway API now handles routing tasks that used to be the exclusive domain of the API gateway, and modern service meshes like Istio Ambient Mesh or Cilium are increasingly moving away from the resource-intensive sidecar model. The trend here is not toward \u201emore and more mesh,\u201c but rather toward <strong>targeted use<\/strong>: Teams are finding that a modern CNI like Cilium already covers much of what used to require a full-fledged service mesh\u2014the added complexity isn\u2019t worth it until the system reaches a certain size. This consolidation is expected to continue in the coming years: fewer separate components, more functionality directly in the kernel (eBPF) and within the Kubernetes platform itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Anyone who deploys a service mesh, API gateway, or message queue also operates the underlying infrastructure. ScaleUp offers <a href=\"https:\/\/www.scaleuptech.com\/blog\/managed-kubernetes-jetzt-scs-zertifiziert\/\">SCS-Certified Managed Kubernetes<\/a> and <a href=\"https:\/\/www.scaleuptech.com\/cloud-services\/\" data-type=\"page\" data-id=\"16363\">Cloud Hosting<\/a> to 100 % in our own <a href=\"https:\/\/www.scaleuptech.com\/rechenzentrum-tour\/\">German data centers<\/a> \u2013 Open source, based on OpenStack and Kubernetes.<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><em>Sources:<\/em><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/arcentry.com\/blog\/api-gateway-vs-service-mesh-vs-message-queue\/\">https:\/\/arcentry.com\/blog\/api-gateway-vs-service-mesh-vs-message-queue\/<br><\/a><a href=\"https:\/\/kubernetes.io\/blog\/2026\/01\/29\/ingress-nginx-statement\/\">https:\/\/kubernetes.io\/blog\/2026\/01\/29\/ingress-nginx-statement\/<\/a><br><a href=\"https:\/\/gateway-api.sigs.k8s.io\/\">https:\/\/gateway-api.sigs.k8s.io\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>How should the microservices communicate with each other? Via service mesh? Via API gateway? Or via message queue?<\/p>","protected":false},"author":2,"featured_media":17162,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,10],"tags":[352,211,354,212,213,353,214,11,216,217,355,218],"class_list":["post-11618","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alle-beitraege","category-kubernetes","tag-ambient-mesh","tag-api-gateway","tag-cilium","tag-consul","tag-deployment","tag-gateway-api","tag-istio","tag-kubernetes","tag-message-queue","tag-microservices","tag-observability","tag-service-mesh"],"_links":{"self":[{"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/posts\/11618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/comments?post=11618"}],"version-history":[{"count":9,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/posts\/11618\/revisions"}],"predecessor-version":[{"id":17172,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/posts\/11618\/revisions\/17172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/media\/17162"}],"wp:attachment":[{"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/media?parent=11618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/categories?post=11618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scaleuptech.com\/en\/wp-json\/wp\/v2\/tags?post=11618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}