Pebellslearn by building
RoadmapsMatrixCoursesSandboxSign in

Course details

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 learn6 sections · 23 lessons
Start learning

Course curriculum

What 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. An In-Memory Data Structure Store12 min
  2. What Redis Is Used For12 min
  3. Redis vs SQL and NoSQL Databases12 min
  4. Starting Redis and Connecting with redis-cli12 min
Strings4 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. SET and GET12 min
  2. INCR and DECR12 min
  3. APPEND and STRLEN12 min
  4. More String Commands12 min
Hashes4 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. HSET and HGET12 min
  2. DEL, EXPIRE and TTL12 min
  3. HGETALL, HDEL and HEXISTS12 min
  4. Hash Use Cases and Choosing a Data Type12 min
Sorted 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. ZADD and ZRANGE12 min
  2. ZRANK and ZREM12 min
  3. ZRANGEBYSCORE and ZCOUNT12 min
  4. ZINCRBY and a Live Leaderboard12 min
Lists4 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. LPUSH and RPUSH12 min
  2. LPOP and RPOP12 min
  3. LRANGE, LINDEX and LLEN12 min
  4. LMOVE and More List Commands12 min
Sets3 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. SADD, SREM and SMEMBERS12 min
  2. SISMEMBER and SCARD12 min
  3. SINTER, SUNION and SDIFF12 min