At MTS Travel, we needed an API gateway solution to support our microservices architecture and provide a single access point for API clients. After evaluating the available options, we chose KrakenD for its speed, extensibility, and open-source principle. In this case study, we’ll discuss why we decided on KrakenD, our experience using the solution, and the complexities we encountered. – Vladimir Kalugin, Backend Lead Developer
KrakenD was a natural choice for us, as many of our services, including MTS Travel, are based on Golang. KrakenD is also faster than its analog competitors Tyk and Kong and is extensible and open.
First, the KrakenD plugin system in Go opens up a lot of possibilities for us to extend the functionality. Tyk is also written in Go; you can write them similarly, but Kong is not. Kong is a Lua application that runs on Nginx. And its primary tool for extending is, therefore, Lua plugins. Although there are options for writing plugins in Go, JS, and Python, they have implementation features that lead to a performance loss. So we stopped considering Kong.
Secondly, when it comes to performance compared to competitors, our tests showed that KrakenD was faster than the competition, which generally correlates with the picture presented by the KrakenD developers on their website (by the way, there are links to the benchmark there, you can run it yourself and check it out).
Finally, if you have a microservices architecture and the frontend is done through an API, microservices will provide different “pieces” of data and business logic. For example, to display a page, the frontend application often goes to various microservices to assemble and display those pieces on the page for the client. That is, your API is spread across multiple microservices. In this situation, you will want a single aggregated place to these data while hiding the microservices complexity from the frontend. This is the task that an API gateway should solve.
In the end, our choice was KrakenD.
We forked the Community version from GitHub, and building a custom Docker image was easy. Of course, we also had to read the documentation to fill out the configuration file correctly, but the graphical designer tool made this process simple.
Once KrakenD was up and running, we needed to export metrics to Prometheus, which was simple to configure. We also needed to change the way KrakenD handles errors by default, exports access logs, and the redirects treatment. We wrote plugins for all this.
After four months of working with KrakenD at MTS Travel, we have been convinced of the high reliability of the API gateway. The main advantage of the solution for us was open source code and plugin mechanism, which allowed us to extend the functionality and address the complexities we encountered. Therefore, we can recommend KrakenD for organizations seeking a reliable and extensible API gateway.
This article is a summarized version in English of the original article in russian language posted on Habr and shared to KrakenD staff by Backend Lead Developer Vladimir Kalugin at MTS Travel.
About MTS Travel
MTS Travel is a service owned by the mobile operator MTS. It allows you to search and book hotels worldwide for the best deals and save on equipment, event tickets, communication, and more.
The service appeared at MTS in 2022, and the database already has more than 16,000 offers of hotels, hostels, and apartments.
Visit MTS Travel