Redis is an in-memory data structure store used as a database, cache, and message broker. Its key mental model is that every key maps to exactly one data type and commands are valid only for that type. Redis 8 (GA 2025) unified what was previously Redis Stack β adding JSON, Time Series, Bloom filters, probabilistic structures, and the new Vector Set type (beta) directly into Redis Open Source. Day-to-day success with Redis comes from choosing the right structure (e.g., sorted sets for leaderboards, streams for event logs, vector sets for semantic search) and using safe key iteration (SCAN) plus explicit expiry (EXPIRE). Treat Redis as a long-running server you secure (ACL/TLS) and observe (INFO, SLOWLOG) rather than "just a library."
What This Cheat Sheet Covers
This topic spans 16 focused tables and 270 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Setup and Introspection
| Concept | Example | Description |
|---|---|---|
redis-cli -h 127.0.0.1 -p 6379 | Connects to a Redis server from the command line. | |
PING | Health check β returns PONG if server is reachable. | |
AUTH default myPassword | Authenticates the current connection (username optional for single-password setup). | |
SELECT 1 | Switches to a logical database (0β15 by default). | |
DBSIZE | Returns number of keys in the currently selected database. | |
INFO memory | Returns server stats and state, optionally filtered by section. | |
CONFIG GET maxmemory | Reads effective runtime configuration values. | |
CONFIG SET maxmemory 1073741824 | Changes supported runtime configuration without restart. |