Databases · Middle · Question 74 of 75

Why is Redis INCR a good fit for a simple rate limiter?

Explanation

Redis runs commands one at a time, so INCR has no race. Use a Lua script or SET ... NX EX to set the TTL safely together with the first increment.

Further reading

Problem with a question

Databases · Middle · question 74

Test yourself

Take the Databases · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz