3 ms·
a minimal rate limiting package for Golang microservice. small weekend project. feedback and stars will be appreciated.
by dasubhajit 2y ago
a minimal rate limiting package for Golang microservice. small weekend project. feedback and stars will be appreciated.
- citrin_ru 2y agoTo avoid race conditions with concurrent requests better to use Redis Lua. See this example: https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff...
- pquerna 2y agoFor this general pattern implemented in Golang, check out redis_rate: https://github.com/ductone/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.
- candiddevmike 2y agoThere 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 https://github.com/ulule/limiter
- yau8edq12i 2y agoI'm sure that the people needing a "serious" solution would realize that a weekend project is probably not that.
- rob74 2y agoStill, 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).
- maerF0x0 2y agoGood for you doing a thing! Please understand the community is likely very wary of single maintainer, weekend project, high risk dependencies right now.