Hacker News new | ask | show | jobs
by lordlarm 4040 days ago
Serious question: why would you not use HAProxy, nginx or similar software which arguably are more battle tested in this domain?
4 comments

For 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.

You can do that when the HTTP call is simple, when you need some logic in the rate limitation ( auth, login ect... ) it's impossible.
The 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".
Four 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