Hacker News new | ask | show | jobs
by citrin_ru 810 days ago
To avoid race conditions with concurrent requests better to use Redis Lua. See this example: https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff...
1 comments

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.