Building Micro Services with .Net Core + Krakend API Gateway

KrakenD vs other products in the market. Requests per second in equal conditions. See benchmarks

.NET Core Web API Micro services with KrakenD Gateway

So to give it a try, I have built two services — UsersService and ProductsService in .NET Core 2.2 with basic CRUD operations and exposed their endpoints via KrakenD gateway. For sake of simplicity, I won’t go into how to write Web API services and DI of data services etc.

Configuration of KrakenD gateway

  • Online API Gateway Designer KrakenD has online designer where you can work with your configuration if you prefer not to edit configuration file. You can download configuration from editor and/or upload file to modify it.
KrakenD api gateway designer
Route mapping of /users to /api/users downstream service in krakend.json
  • output_encoding: type of output encoding. Note that, if your backend doesn’t sends any response set this value to “no-op” otherwise you will get an error.
  • backend: Configuration for your backend API.
  • backend/host: Address of downstream service
  • backend/url_pattern: endpoint of downstream service to hit
  • backend/is_collection: if downstream service sends an array of objects then this property should be set.
  • backend/encoding: type of output encoding. Note that, if your backend doesn’t sends any response set this value to “no-op” otherwise you will get an error.

Support

KrakenD has very good documentation and slack channel for discussion.

Summary

I think KrakenD has bright future. Their enterprise product and services looks promising. Based on open source community feedback and usage, I hope they will keep adding more features and support for community edition as well.

Complete krakend.json for demo project

krakend.json file products and users micro services CRUD operations

--

--

Google Developer Expert Angular | Architect | Author | https://www.linkedin.com/in/balram-chavan | https://www.hiretheauthor.com/balramchavan

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store