Redis flashcards
In-memory data store for caching, queues and counters.
What is Redis, in one plain sentence?
Redis is a very fast storage program that keeps small pieces of data in , the computer's quick working memory, so apps can save and fetch them in a blink.
Tap to turn over. Swipe right if you know it, left to see it again.
What you will learn
Start from zero
- What Redis is and why it exists4 cards
- Keys, values, caching and value types3 cards
- Servers, commands and your first commands3 cards
- Before and after this topic2 cards
Core basics
- Jobs Redis does and connecting3 cards
- Strings, key names and expiry5 cards
- Locks and job queues2 cards
- Hashes, sets and sorted sets3 cards
- Safe habits in production2 cards
Next steps
- Caching patterns and sessions2 cards
- Round trips and transactions3 cards
- Messaging: pub/sub and streams3 cards
- Persistence and memory limits3 cards
- Rate limits and scheduled jobs2 cards
- Redis 8, JSON and the threading model3 cards
- Geo search and hash field expiry2 cards
Go deeper
- Lua scripts and Functions3 cards
- Replication, Sentinel and Cluster3 cards
- Hot keys and big keys3 cards
- Diagnosing latency and memory2 cards
- Client-side caching, HyperLogLog and vectors3 cards
- Security, licensing and cache consistency3 cards
Final test and certificate
10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.
Take the final testAbout these cards
- Reviewed 26 October 2026
- CoversRedis Open Source 8.10Valkey 9.0 (fork, for comparison)RESP3 protocol
Checked against
Redis at a glance
Redis is a very fast store that keeps small pieces of data in memory so apps can fetch them instantly.
Like a sticky-note board next to the kitchen counter: quick to read, small, and old notes can fall off by themselves.
Words you will meet
- Key
- The name of a box of data, like user:42:name
- Value
- What is stored inside the box
- RAM
- The computer's fast working memory
- Cache
- A saved copy of an answer so slow work is not repeated
- TTL
- Time to live: seconds left before a key is deleted
- Command
- One instruction to Redis, like SET or GET
- Atomic
- Done fully in one go, never half
- Queue
- A line of jobs waiting their turn
The steps
- 1. Start from zero (12 cards): What Redis is, why it is fast, the key words and your first commands.
- 2. Core basics (15 cards): Keys, strings, expiry, counters and the five core data types.
- 3. Next steps (18 cards): Caching patterns, pipelining, transactions, streams, persistence and memory.
- 4. Go deeper (17 cards): Scripting, cluster and failover, stampedes, big keys, locks, memory and security.
All 12 cards in Start from zero
- What is Redis, in one plain sentence?
- Redis is a very fast storage program that keeps small pieces of data in RAM, the computer's quick working memory, so apps can save and fetch them in a blink.
- What was the problem before Redis?
- Every page load asked the main database the same question again, even when the answer had not changed. Pages felt slow and the database got overworked; Redis keeps the ready answer close by.
- Where do you already meet Redis in daily life?
- The like count on a post, staying logged in on a site, an OTP that expires in 5 minutes, 'you are number 3 in the queue' and a live game scoreboard often run on Redis.
- What everyday thing is Redis like?
- A sticky-note board next to the kitchen counter, while the big storeroom is the main database. The board is quick to read, has limited space, and old notes can be set to fall off by themselves.
- What are a 'key' and a 'value'?
- A key is the name on a box and the value is what is inside, like key
user:42:nameholdingMohan. Values are often JSON, a text way to write data such as{"name":"Tea"}. - What do 'cache', 'expiry' and 'TTL' mean?
- A cache is a saved copy of an answer, so slow work is not repeated. Expiry is the moment Redis deletes a key by itself, and TTL (time to live) is how many seconds it has left.
- What are a server, a client, a port and a query?
- The Redis server is the program waiting for requests; a client is whatever talks to it, like your app or
redis-cli. A port is a numbered door on a computer (Redis uses 6379), and a query is a question sent to a database. - What kinds of value can Redis hold?
- A string (text or a number), a list (items in a line), a set (a bag with no repeats), a hash (a small form with fields) and a sorted set (a scoreboard kept in order).
- What do 'command', 'atomic', 'queue' and 'worker' mean?
- A command is one instruction, like
SETorGET. Atomic means done fully in one go, never half; a queue is a line of jobs waiting, and a worker is a program that picks up jobs and does them. - What do you need before starting?
- Nothing to follow the ideas. To try commands, install Redis (free) and open
redis-cliin a terminal, the window where you type commands. - Your first tiny win: what do these two commands do?
SETsaves the value "Hello" under the keygreeting, and Redis replies OK.GETreads it back.- What will you be able to do after this topic?
- Cache slow answers, count views safely, build a simple job queue and a live leaderboard, and keep a busy Redis server healthy.
Redis cheatsheet
Strings and keys
SET k v EX 600Set with 10 min expirySET k v NX PX 30000Set only if missing (lock)SET k v KEEPTTLOverwrite, keep expiryINCR k / INCRBY k 5Atomic counterMGET a b c / MSET a 1 b 2Many keys, one tripTTL k / PERSIST kTime left / remove expiryUNLINK kDelete without blockingSCAN 0 MATCH user:* COUNT 1000Iterate keys safely
Hashes, lists, sets
HSET k f v / HGETALL kObject fieldsHEXPIRE k 60 FIELDS 1 fExpire one field (7.4+)LPUSH q x / BRPOP q 30Blocking FIFO queueLMOVE src dst RIGHT LEFTReliable queue hand-offSADD k m / SISMEMBER k mUnique membersZINCRBY lb 10 mAdd to scoreZRANGE lb 0 9 REV WITHSCORESTop 10ZRANGE k -inf now BYSCOREDue delayed jobs
Streams and messaging
XADD s MAXLEN ~ 100000 * f vAppend, cappedXGROUP CREATE s g $ MKSTREAMCreate consumer groupXREADGROUP GROUP g c BLOCK 5000 STREAMS s >Read new entriesXACK s g idMark doneXPENDING s gUnacked summaryXAUTOCLAIM s g c 60000 0-0Take over stuck entriesPUBLISH ch msg / SUBSCRIBE chFire-and-forget fan-out
Ops and debugging
INFO memory / INFO statsMemory, hits, evictionsSLOWLOG GET 10Slowest recent commandsLATENCY DOCTORExplain latency spikesredis-cli --bigkeysFind oversized keysMEMORY USAGE kBytes used by one keyCLIENT LISTWho is connectedCONFIG SET maxmemory-policy allkeys-lfuCache evictionredis-cli --latencyMeasure round-trip time
Security and HA
ACL SETUSER app on >pw ~shop:* +@read +@writeLeast-privilege userACL SETUSER default offDisable the open default userbind 10.0.1.10 + protected-mode yesPrivate network onlytls-port 6380Encrypt trafficsentinel monitor name ip 6379 2Failover with quorum 2CLUSTER KEYSLOT kWhich slot a key maps to{user:42}:cartHash tag: same slot