All posts

Learn Redis Without Installing Anything

July 31, 2026 · DevTools

redis
database
caching
nosql
learning

Redis has a reputation for being approachable — "it's just a key-value store" — until you meet its five core data structures and realize each one solves a different class of problem. The fastest way to build intuition is to type the commands and watch the responses. The Redis CLI Simulator gives you a working Redis terminal in the browser, no server or signup, so you can try every example below right now.

Strings: the building block

Every key holds a value, and a string value is the default. Strings double as counters thanks to atomic increments.

SET visits 0
INCR visits        -> 1
INCR visits        -> 2
GET visits         -> "2"
APPEND visits "!"  -> (length)

INCR is atomic, which is why Redis is popular for rate limits and counters — you never read-modify-write, you just increment and let Redis serialize it.

Hashes: objects without JSON

A hash maps fields to values under one key — think of it as a tiny object. It's cheaper and cleaner than serializing JSON for things like a user profile.

HSET user:1 name Ada role admin age 36
HGET user:1 role        -> "admin"
HGETALL user:1          -> name / Ada / role / admin / age / 36
HLEN user:1             -> 3

Lists and queues

A list is an ordered sequence keyed at both ends, which makes it a natural FIFO queue or activity feed.

RPUSH queue job-a job-b job-c
LPOP queue            -> "job-a"
LRANGE queue 0 -1     -> "job-b" \n "job-c"
LLEN queue            -> 2

LPUSH/RPOP give you the other direction; together they make a deque.

Sets: membership and uniqueness

A set is an unordered collection of unique strings — perfect for tags, favorites, or deduplication.

SADD tags redis database caching
SISMEMBER tags redis   -> 1
SISMEMBER tags sql     -> 0
SCARD tags             -> 3
SMEMBERS tags          -> (the three members)

Sorted sets: leaderboards and ranking

A sorted set members carry a score and are kept ordered by it. This is the data structure behind leaderboards, priority queues, and "top N" features.

ZADD scores 150 ada 200 grace 120 alan
ZRANGE scores 0 -1 WITHSCORES   -> alan / 120 / ada / 150 / grace / 200
ZSCORE scores grace             -> "200"

Expiry and the big picture

Keys can expire, which is what makes Redis a great cache. Combine expiry with the structures above and you get session stores, rate-limit buckets, and time-windowed analytics.

SET session:abc "user-data" EX 3600
TTL session:abc        -> (seconds remaining)
EXPIRE visits 60
PERSIST visits

Practice without the install step

The barrier to learning Redis is usually the setup — install a server, find the CLI, open a port. The simulator removes all of that: type any supported command, press Enter, recall history with the arrow keys, and reset the store with FLUSHALL whenever you want a clean slate. It's a learning and prototyping sandbox, not a database — the store lives only in your tab — but it's enough to build real muscle memory for the five structures before you ever touch a production instance.

Tools mentioned in this post