Introduction to the KrakenD API Gateway.

KrakenD is a modern open source API Gateway written in Golang. Currently, its performance is the fastest on the market thanks to its stateless architecture. This gives developers the flexibility to filter and manipulate responses from multiple services. Also, it comes with a lot of middlewares that help to secure transport, add authentication, throttle connections, and much more.

Consider this typical use case of KrakenD: You have a complex system with many services, and UI consumers want to call your backend. They need to do extra implementations to receive the responses from the server. Even if they’re interested in particular data only, they still have to wait for the whole response and then filter the data.

Here is how KrakenD comes into play. It adds a layer between your system and the client. Thanks to that layer, the consumer receives the information they want without having to change their implementation.

In this article, we’ll take a look at the main benefits of using KrakenD.

Merge Service Responses Into One

You can manipulate the content you receive from the backend before returning it to the client. Let’s see a simple example that illustrates how KrakenD gives you the flexibility to achieve this without any coding.

Prepare the backend data

I’m going to merge the filtered response of two services into one. Instead of writing the services myself, I’m going to use  JSONPlaceholder. It’s a handy fake API for testing and prototyping. It has a set of predefined resources that can be used to generate dummy data.

I’ve chosen the posts and comments services.

Open this URL in your browser to see one of the posts:

https://jsonplaceholder.typicode.com/posts/1

#microservices #devops #programming

How To Effortlessly Adopt Microservices Using KrakenD
2.65 GEEK