Hacker News new | ask | show | jobs
by dasubhajit 810 days ago
a minimal rate limiting package for Golang microservice. small weekend project. feedback and stars will be appreciated.
3 comments

To avoid race conditions with concurrent requests better to use Redis Lua. See this example: https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff...
For this general pattern implemented in Golang, check out redis_rate: https://github.com/ductone/redis_rate

This fork also implements Redis Client Pipelining to check multiple limits at the same time, and Concurrency Limits.

Good for you doing a thing! Please understand the community is likely very wary of single maintainer, weekend project, high risk dependencies right now.
There aren't any tests...?

If folks are looking for a serious rate limiting package for Go, limiter is a good start: https://github.com/ulule/limiter

I'm sure that the people needing a "serious" solution would realize that a weekend project is probably not that.
Still, the README says:

> For production use, fork it and made changes based on your need.

...instead of the standard "this is work in progress/just a prototype/weekend project, don't use it in production!" disclaimer (which of course won't reliably stop people from using it in production either, but at least they can't say they haven't been adequately warned).