Typical use cases
- Caching — store the result of an expensive SQL query for N seconds
- Sessions — fast session storage instead of a database
- Queues — reliable broker for background jobs; workers read tasks via BRPOP or Streams
- Rate limiting — atomic counter increment per time window
- Pub/Sub — broadcast events between services in real time
Persistence
Redis stores data in memory but supports two disk-dump modes: RDB (snapshots) and AOF (log of all operations). Persistence is not critical for caching — for queues, enable AOF.