Redis INCR and EXPIRE

Redis INCR atomically increments an integer stored at a key, while EXPIRE assigns a time-to-live after which the key is deleted. Together they can implement a basic fixed-window request counter when the key identifies a particular client and window.

Learn this concept

Lesson 1.20 · Redis fundamentals and the Go client

Used in exercises

Exercise 1.22 · Redis fixed-window limiter that fails open Exercise 6.14 · Admin order statistics