r/devops • u/Safe-Molasses2051 • Jul 26 '25
API GATEWAY
I have been tasked to create a prototype for an API gateway for my company which we shall sell as a saas. I have not done such a project before and here is how i have been thinking about approaching the problem.
Use Nginx as a reverse proxy then business logic in Go or C/C++ and Redis pub/sub for caching.
Coming up with a reverse proxy first then modifying it into a gateway
Just start everything from scratch.
am a junior and i have never encountered such, if there is a better way and please guide . help align my thinking
31
u/log1kal Jul 26 '25
Is there a reason you’re not starting with evaluating drop-in open source api gateways first?
-38
u/Safe-Molasses2051 Jul 26 '25
first used kong and senior liked the idea so wants one built in house
49
u/log1kal Jul 26 '25
Your senior is messing with you, hopefully. Or there are reasons we don’t know from the outside. Or they’re incompetent.
This is just a colossally weird thing to do. “I like this thing that’s free and we can have working now. Let’s make our own instead, and relearn all the mistakes that project already figured out for years! What could go wrong!?”
5
2
1
u/alshayed Jul 26 '25
To be fair it might be a good idea to stop using OSS Kong. It looks like they’re abandoning both the OSS and free enterprise versions
15
u/log1kal Jul 26 '25
Reasonable, but the next step would be something else out there, not BYO.
3
3
u/carsncode Jul 26 '25
Or, if they actually want to invest in maintaining one in house and are worried about Kong closing source, fork Kong if and when the license changes
3
u/alshayed Jul 27 '25
Kong announced with enterprise edition v3.10 that free mode is gone. They’ve also published EE v3.11.
The latest open source version is 3.9 and they’re not responding to any requests asking for clarification on GitHub or their forum last I checked. So it looks like they are quiet quitting the open source edition.
2
u/carsncode Jul 27 '25
It's Apache license, it can be forked like every other project that pulls the same BS.
40
11
3
9
152
u/Farrishnakov Jul 26 '25
Don't start with the solution. Start with the problem. What is the problem you're trying to solve that isn't handled by existing providers?
What is the measure of success? Do you have the capital to even take this project on?
Until you have those answers, there is nothing to start.
2
27
u/Fruloops Jul 26 '25
tasked to create API gateway prototype to sell as a saas
junior developer with no experience on such projects
Whoever made this decision is smoking the good shit. It's a cool project though
8
7
u/Narabug Jul 26 '25
I have to imagine this is exactly how most of my companies trashcan “internal apps” came about
7
u/burunkul Jul 26 '25
Get an image of any existing API Gateway and push it to your private registry.
4
u/__matta Jul 26 '25
Look at OpenResty. You can code modules in Lua. Probably the simplest option.
I wouldn’t use Go unless the entire proxy was Go. You could write custom Caddy modules. It is painful to link into C code and probably too slow.
I would not start from scratch. It is easy to get something working but there is a long tail of issues to deal with. Look at Pingora (Rust) if you need a low level toolkit.
3
u/JagerAntlerite7 Jul 26 '25
Checkout Connexion.
Connexion is a modern Python web framework that makes spec-first and api-first development easy. You describe your API in an OpenAPI (or swagger) specification with as much detail as you want and Connexion will guarantee that it works as you specified.
Used it ten four years ago for a long running project and was really pleased. There may be better options available, yet still worth checking out.
EDIT: Typos
2
u/JPJackPott Jul 27 '25
This is bonkers but I have been in a position where this has been genuinely required for a niche case. You’re thinking along the right lines with nginx and business logic behind it, that can take you a long way.
Getting it behind a cloud managed ALB with a WAF helps a lot
2
1
u/Unique_Row6496 Jul 26 '25
Focus first, on what the API gateway is going to support, and/or enable. E.g., will it help a client discover and bind to a given endpoint? That is the API gateway requirements and set of interactions.
Presumably, you need an authentication mechansism. How do you envision that working?
Does the API GE have different actors (and roles) connecting? Does your solution need authorization - to distinguish between classes of users and what they can (can not) access?
What communication protocols are you considering gRPC, RESTful, other? Does the protocol support your signalling needs - e.g., routing, timeliness, redirection, etc., etc.
Will the API be exclusively synchronous or a mix of asynchronous and synchronous exchanges?
Lots of questions to be answered. 😊🤘
https://www.coudo.ai/blog/design-an-api-gateway-system
https://medium.com/design-microservices-architecture-with-patterns/api-gateway-pattern-8ed0ddfce9df
1
u/Current_Variation938 Jul 26 '25
you can setup nginx to be ur api gateway. it can do what the api gateway pattern demands
-1
0
u/phxees Jul 26 '25
For a prototype I would likely use the FastAPI Python library. Without more details I don’t see what the challenges might be, but unless they want something customers could use I wouldn’t worry about caching.
You can get something spun up in a day in the environment or your choice with endpoints which look familiar. From there you can add some basic functionality and then have a more detailed discussion about what is important to demo.
If it is infrastructure then you might be done with the API if it is something else then you shift your focus there.
3
u/RustOnTheEdge Jul 26 '25
FastAPI is for buildings apis, not API Gateways lol
2
u/phxees Jul 26 '25
OP mentioned writing an API using Go or C++ with Redis cache, maybe I misunderstood, but it seemed like they needed both.
142
u/BeasleyMusic Jul 26 '25
Boy you are setup for failure lol there’s a million API gateways out there that are fully mature and featured products, do you know what your competitors are? What’s your value add?