TodayTools

Redis flashcards

In-memory data store for caching, queues and counters.

Donate
Beginner friendly, starts from zero
Section
How to study
0
RedisStart from zero · 1 of 12

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.

Redis = data at the speed of memory.
Show again
12 left
Got it

Tap to turn over. Swipe right if you know it, left to see it again.

All topics

What you will learn

  1. 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
  2. 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
  3. 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
  4. 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 test

About these cards

  • Reviewed 26 October 2026
  • CoversRedis Open Source 8.10Valkey 9.0 (fork, for comparison)RESP3 protocol
How these cards are made

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. 1. Start from zero (12 cards): What Redis is, why it is fast, the key words and your first commands.
  2. 2. Core basics (15 cards): Keys, strings, expiry, counters and the five core data types.
  3. 3. Next steps (18 cards): Caching patterns, pipelining, transactions, streams, persistence and memory.
  4. 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:name holding Mohan. 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 SET or GET. 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-cli in a terminal, the window where you type commands.
Your first tiny win: what do these two commands do?
SET saves the value "Hello" under the key greeting, and Redis replies OK. GET reads 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 600 Set with 10 min expiry
  • SET k v NX PX 30000 Set only if missing (lock)
  • SET k v KEEPTTL Overwrite, keep expiry
  • INCR k / INCRBY k 5 Atomic counter
  • MGET a b c / MSET a 1 b 2 Many keys, one trip
  • TTL k / PERSIST k Time left / remove expiry
  • UNLINK k Delete without blocking
  • SCAN 0 MATCH user:* COUNT 1000 Iterate keys safely

Hashes, lists, sets

  • HSET k f v / HGETALL k Object fields
  • HEXPIRE k 60 FIELDS 1 f Expire one field (7.4+)
  • LPUSH q x / BRPOP q 30 Blocking FIFO queue
  • LMOVE src dst RIGHT LEFT Reliable queue hand-off
  • SADD k m / SISMEMBER k m Unique members
  • ZINCRBY lb 10 m Add to score
  • ZRANGE lb 0 9 REV WITHSCORES Top 10
  • ZRANGE k -inf now BYSCORE Due delayed jobs

Streams and messaging

  • XADD s MAXLEN ~ 100000 * f v Append, capped
  • XGROUP CREATE s g $ MKSTREAM Create consumer group
  • XREADGROUP GROUP g c BLOCK 5000 STREAMS s > Read new entries
  • XACK s g id Mark done
  • XPENDING s g Unacked summary
  • XAUTOCLAIM s g c 60000 0-0 Take over stuck entries
  • PUBLISH ch msg / SUBSCRIBE ch Fire-and-forget fan-out

Ops and debugging

  • INFO memory / INFO stats Memory, hits, evictions
  • SLOWLOG GET 10 Slowest recent commands
  • LATENCY DOCTOR Explain latency spikes
  • redis-cli --bigkeys Find oversized keys
  • MEMORY USAGE k Bytes used by one key
  • CLIENT LIST Who is connected
  • CONFIG SET maxmemory-policy allkeys-lfu Cache eviction
  • redis-cli --latency Measure round-trip time

Security and HA

  • ACL SETUSER app on >pw ~shop:* +@read +@write Least-privilege user
  • ACL SETUSER default off Disable the open default user
  • bind 10.0.1.10 + protected-mode yes Private network only
  • tls-port 6380 Encrypt traffic
  • sentinel monitor name ip 6379 2 Failover with quorum 2
  • CLUSTER KEYSLOT k Which slot a key maps to
  • {user:42}:cart Hash tag: same slot
Donate