5 ms·
> But you should really just roll your own As someone who already did this (because no other solution with our needs was available), I strongly disagree. Most
by denysvitali 2y ago
> But you should really just roll your own
As someone who already did this (because no other solution with our needs was available), I strongly disagree.
Most of the time, NGINX, Caddy, Traefik or APISIX are enough. The only time I felt the need to implement an API Gateway from scratch was to support a very specific use case with a specific set of constraints. No matter how robust the Go standard library is, implementing an API Gateway from scratch is rarely a good idea.
- vrosas 2y agoIn my experience those specific sets of constraints come sooner or later. Someone is going to ask for some complex auth or routing rules and it’s easier to just write it in go than it is to learn a whole new DSL or lua to implement it.
- denysvitali 2y agoComplex Auth: https://doc.traefik.io/traefik/middlewares/http/forwardauth/ https://doc.traefik.io/traefik/middlewares/http/forwardauth/ Complex routing rules: https://doc.traefik.io/traefik/routing/routers/ https://doc.traefik.io/traefik/routing/routers/ If you need something more than this, you're either in a very specific situation (where an API Gateway written from scratch might be a good idea) or that someone is doing something wrong
- vrosas 2y agoWhy would I want to write another service to handle auth? That’s somehow less complex than just writing it into my gateway?
- Aeolun 2y agoI sort of agree with you, but only if you aren’t in a position to say ‘the software doesn’t support it’.
- tluyben2 2y agoWe had a specific use case that was needed urgently which we couldn't get working with any of the standard systems, so we used Go. Works very well. It is sometimes simply a matter of time; we needed it before the morning (for a launch) and in discord/reddit people were providing solutions with haproxy, nginx, traefik etc that should work according to the docs but just didn't.