Redis data structures, key expiry, persistence with RDB and AOF, pub/sub, transactions, eviction policies and clustering.
39 cards · basic cards · AI-written, checked twice. Edit anything.
- What is a Redis string?
Show answer
A simple key-value data structure that holds text or binary data
- What is a Redis list?
Show answer
An ordered sequence of values that can be pushed and popped from both ends
- What is a Redis set?
Show answer
An unordered collection of unique values with no duplicates allowed
- What is a Redis sorted set?
Show answer
A set where each member has an associated score for ordering
- What is a Redis hash?
Show answer
A map of field-value pairs, like a dictionary or nested object
- What is a HyperLogLog in Redis?
Show answer
A probabilistic data structure for estimating distinct element counts with fixed memory
- What is a Redis stream?
Show answer
An append-only log of entries with unique IDs and automatic timestamps
- What is a Redis bitmap?
Show answer
A string treated as a bit array for bitwise operations and flags
- What does the EXPIRE command do?
Show answer
Sets a time-to-live (TTL) in seconds after which a key automatically expires
- What does the TTL command return?
Show answer
The number of seconds until key expiration, -1 if no expiry, or -2 if key does not exist
- What does PERSIST do?
Show answer
Removes the TTL from a key, making it never expire
- How does Redis handle key expiration?
Show answer
Through lazy deletion on access plus periodic active cleanup scanning the keyspace
- What is RDB persistence?
Show answer
Point-in-time snapshots of the entire database saved as a binary dump file
- What is AOF (Append-Only File) persistence?
Show answer
A log that appends every write command, replaying them on restart for durability
- What is the difference between SAVE and BGSAVE?
Show answer
SAVE blocks the server, BGSAVE forks a background process to save without blocking