Skip to content
Pebellslearn by building

The course

Redis

Learn what Redis is, when to reach for it, and how its core data types work. You will cache values, count visits, keep player profiles, run a live leaderboard, queue jobs and compare sets — all inside one small word game.

Ready to learn

Your path through the ideas

Inside the course

7 modules · 23 lessons
CLI tools & setup · Start here

Install your tools, choose your setup and verify a local run.

02What is Redis?4 lessons

Meet Redis: what 'in-memory data structure store' really means, the jobs it is hired for, how it compares with SQL and other NoSQL databases, and how to start a server and talk to it.

  1. 01An In-Memory Data Structure Store12 min
  2. 02What Redis Is Used For12 min
  3. 03Redis vs SQL and NoSQL Databases12 min
  4. 04Starting Redis and Connecting with redis-cli12 min
03Strings4 lessons

Store and read values with SET and GET, count safely with INCR and DECR, grow values with APPEND, measure them with STRLEN, and move many keys at once.

  1. 01SET and GET12 min
  2. 02INCR and DECR12 min
  3. 03APPEND and STRLEN12 min
  4. 04More String Commands12 min
04Hashes4 lessons

Store a player profile as a hash with HSET and HGET, give keys a lifetime with EXPIRE and TTL, read and remove fields with HGETALL, HDEL and HEXISTS, and learn which data type to pick for a job.

  1. 01HSET and HGET12 min
  2. 02DEL, EXPIRE and TTL12 min
  3. 03HGETALL, HDEL and HEXISTS12 min
  4. 04Hash Use Cases and Choosing a Data Type12 min
05Sorted Sets4 lessons

Build Wordcraft's leaderboard: add scored members with ZADD, read them in order with ZRANGE, find positions with ZRANK, remove with ZREM, filter by score with ZRANGEBYSCORE and ZCOUNT, and award points with ZINCRBY.

  1. 01ZADD and ZRANGE12 min
  2. 02ZRANK and ZREM12 min
  3. 03ZRANGEBYSCORE and ZCOUNT12 min
  4. 04ZINCRBY and a Live Leaderboard12 min
06Lists4 lessons

Use lists for Wordcraft's match queue and activity feed: push with LPUSH and RPUSH, pop with LPOP and RPOP, read with LRANGE, LINDEX and LLEN, and hand items between lists with LMOVE.

  1. 01LPUSH and RPUSH12 min
  2. 02LPOP and RPOP12 min
  3. 03LRANGE, LINDEX and LLEN12 min
  4. 04LMOVE and More List Commands12 min
07Sets3 lessons

Track Wordcraft badges and friends with sets: add and remove with SADD and SREM, test and count with SISMEMBER and SCARD, and compare groups with SINTER, SUNION and SDIFF.

  1. 01SADD, SREM and SMEMBERS12 min
  2. 02SISMEMBER and SCARD12 min
  3. 03SINTER, SUNION and SDIFF12 min
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.