Key takeaway
- KrakenD API gateway for microservices: what it is, how to run it, features by edition, how it compares with Kong and Nginx, and when to use one.
KrakenD is an open-source API gateway that sits in front of your microservices and gives clients one entry point. According to its docs, it is a declarative, high-performance gateway that needs no programming: you describe endpoints and backends in a JSON file, and KrakenD aggregates, filters and secures the traffic. This guide explains when it fits, how to run it and what to check before you adopt it. KrakenD overview.
KrakenD is one way to apply the API gateway pattern. If you are still choosing an architecture, start with our guide to microservices architecture and design patterns and our comparison of service-oriented architecture and microservices.
What is an API gateway for microservices?
The microservices.io pattern catalogue describes an API gateway as the single entry point for all clients of a microservices application. It either proxies a request to the right service or fans it out to several services. It can also expose a different API for each client type and handle security such as authorisation checks. Source: microservices.io, API Gateway pattern.
The same source lists the benefits (clients are shielded from how the application is split into services, fewer round trips, protocol translation) and the cost: the gateway is another moving part to build, deploy and manage, and it adds a network hop, which that source considers insignificant for most applications.
What is KrakenD and how is it different?
KrakenD is written in Go and is built on the Lura Project, a Linux Foundation project (formerly the KrakenD Framework), according to its docs. Its design rules, as the docs list them, include reactive, fail fast, keep it simple, everything pluggable and request-scoped processing. The docs describe two states: a building state, where it parses configuration and prepares middleware, and a working state, where routes are already mapped in memory.
It is also stateless. The Community Edition repository on GitHub describes it as a high-performance, stateless, declarative API gateway written in Go and lists the Apache-2.0 licence. The deployment docs say its nodes do not need to communicate with each other, and that a configuration change requires a restart, as with other stateless services such as Nginx. KrakenD CE on GitHub and KrakenD deployment docs.
How do you run KrakenD from the command line?
The run guide gives the basic command below. The flags it documents are -c or --config for the configuration file and -d or --debug for debug mode. By default KrakenD listens on port 8080, and the docs show a health check at /__health. Confirm port and other options in the run guide.
krakend run -c krakend.json
The minimal configuration in the docs declares the schema and version 4: { "$schema": "https://www.krakend.io/schema/v3.0/krakend.json", "version": 4 }. For containers, the docs say an immutable Docker image with your configuration takes a few seconds to build in a CI/CD pipeline, and recommend at least two instances for high availability.
How do endpoints and aggregation work?
Each endpoint object has an endpoint path, a method (default GET) and a backend array. Each backend sets a host and a url_pattern. A single endpoint can list several backends, and KrakenD merges their responses into one, using a fork-and-join middleware with a timeout. The output_encoding field defaults to json. Endpoint docs and design docs.
What features does KrakenD provide?
The tables below use only what the KrakenD docs state. Edition details change, so confirm on the Enterprise overview page before you buy or build.
| Capability | What the docs say | Edition |
|---|---|---|
| Aggregation and response shaping | Merges several backend calls into one endpoint, with filtering and encoding options | Community |
| Endpoint, client and proxy rate limits | Stateless limits per endpoint, per end user and between KrakenD and backends | Community |
| Circuit breaker | Halts requests to a failing backend after consecutive failures | Community |
| Stateful (Redis) and tiered rate limiting | Listed as additional Enterprise options | Enterprise |
| Centralised authentication, RBAC, GitOps auditing, SLA support | Listed on the Enterprise overview, which says Enterprise has over 30 additional features | Enterprise |
| Extra backends such as gRPC, Kafka, RabbitMQ, NATS | Listed as Enterprise service connectivity | Enterprise |
Check the docs for security headers and authentication options that your version supports.
How does KrakenD compare with Kong, Nginx, MuleSoft and Postman?
These products do different jobs, so a tick-box matrix misleads. The table below quotes each vendor's own wording.
| Product | How its own site describes it | Where it fits |
|---|---|---|
| KrakenD | Declarative, high-performance, open-source API gateway needing no programming (krakend.io) | Aggregation and BFF-style gateways configured in JSON |
| Kong Gateway | A lightweight, fast and flexible cloud-native API gateway (developer.konghq.com) | General-purpose API gateway; confirm editions on its site |
| Nginx | Docs say a common use of a reverse proxy is load balancing (docs.nginx.com) | Reverse proxy and load balancer in front of services |
| MuleSoft Anypoint | A centralised API management platform, with a secure, high-performance gateway (mulesoft.com) | Full API management in a MuleSoft estate |
| Postman | Describes itself as API engineering for your agents (postman.com) | API design and testing tooling, not a runtime gateway |
How fast is KrakenD?
KrakenD's benchmark page claims about 18,000 requests per second on an ordinary laptop, and lists Amazon EC2 results from 10,126 requests per second on a c4.2xlarge to 2,758 on a t2.micro. The page footer is dated 28 October 2016 and the laptop is a 2015 MacBook Pro, so treat these as historic vendor figures, not a forecast for your workload. Load test with your own routes, payloads and backends. KrakenD benchmarks page.
When should you choose a gateway, and when not?
| Situation | Suggested approach | Trade-off |
|---|---|---|
| Many clients need data from several services | Gateway with aggregation, such as KrakenD | One more component to deploy and run |
| You only need load balancing or TLS termination | A reverse proxy may be enough | No response merging |
| You need full API lifecycle management and a developer portal | Evaluate a management platform | More cost and platform scope |
| Agents and automations call your APIs | Put rate limits, authentication and audit logging at the gateway | Policy must be kept in step with the backends |
For testing and deployment practice around gateways, see our guides to microservices testing and developing and deploying Spring Boot microservices.
How do you govern gateway traffic when AI agents call your APIs?
A gateway is a natural place to enforce who may call what, and how often. When AI agents become API consumers, the harder question is which decisions they are allowed to take and on what context. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control. AgentGRC keeps autonomous agent actions inside policy, with the audit trail risk teams need.
What should you do first?
- List the client types and the services each one needs; draw the calls you would aggregate.
- Run the minimal configuration locally and check
/__health. - Add one aggregated endpoint, then rate limits and a circuit breaker.
- Load test with your own traffic and decide between Community and Enterprise on the docs comparison.
- Build the configuration into an immutable image and run at least two instances.
To map one API decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
FAQ
What is KrakenD used for?
According to its docs, KrakenD is an open-source API gateway that aggregates multiple microservices behind single endpoints and can filter, throttle and authenticate traffic.
Is KrakenD free?
The Community Edition is open source under the Apache-2.0 licence, according to its GitHub repository. An Enterprise Edition adds features and SLA-backed support; confirm current terms on krakend.io.
Does KrakenD need a database?
The deployment docs say its nodes do not need to communicate with each other, and the repository describes it as stateless. Configuration lives in a JSON file.
How do you start KrakenD?
Run krakend run -c krakend.json. It listens on port 8080 by default and the docs show a health check at /__health.
Can KrakenD replace Nginx?
They overlap but differ. Nginx docs describe load balancing as a common reverse proxy use, while KrakenD focuses on aggregation and API gateway policies. Test both on your own traffic.
Are the old KrakenD benchmark figures still valid?
The vendor benchmark page is dated 28 October 2016, so treat the figures as historic and run your own load test.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE