5 ms·
Serious question: why would you not use HAProxy, nginx or similar software which arguably are more battle tested in this domain?
by lordlarm 11y ago
Serious question: why would you not use HAProxy, nginx or similar software which arguably are more battle tested in this domain?
- Thaxll 11y agoYou can do that when the HTTP call is simple, when you need some logic in the rate limitation ( auth, login ect... ) it's impossible.
- jamescun 11y agoFor general rate limiting, yes HAProxy or Nginx make more sense. Having different rate limits for different endpoints becomes unmanageable in HAProxy/Nginx; and having different rate limits say across different plans or users is all but impossible.
- didip 11y agoFour startups ago, I did a simpler one in Nginx using embedded Lua and Redis. It can definitely be done, but writing it in Go is easier, and funner :D
- brightball 11y agoThe best reason I can imagine is so that it can all be wrapped in your portable Go binary. Because of the portability aspect, there are a lot of use cases for Go similar to Java where there is an incentive to do everything "in Go".