Tutorials

Learn Redis and Valkey by building a game

Short levels, real code in your language, and a sandbox in your browser. Earn XP, unlock achievements, and find out what an in-memory key/value store can do.
Valkey sandbox · runs in your browser

Type a command, or pick one below.

Try

A real-ish Valkey, right here. No account needed.

Choose your track

Both tell one story, level by level, in Node.js, Python, Go or Java.
BeginnerFree on Starter9 levels · 45 min

Build a game backend

Caching, counters, a live leaderboard, rate limiting and pub/sub: the backend of a tiny arcade game, one level at a time.

  1. 1Insert coin
  2. 2Save the game
  3. 3Turbo mode
  4. 4Count everything
  5. 5High scores
  6. 6Player profiles
  7. 7Anti-cheat
  8. 8Live feed
  9. 9Boss level
AdvancedComing soonCasual or Pro

Build a durable job pipeline

Streams, consumer groups, retries, locks and idempotency: background jobs that survive crashes and restarts.

  1. Append-only log
  2. Many hands
  3. Nothing gets lost
  4. One at a time
  5. Charge once
  6. Later, please
  7. Survive a restart
  8. Boss level
Casual and Pro are coming soon
Jobs have to survive a restart, so this track needs a plan with persistent storage.
See what's inside

What you'll know how to build

Each level is one data structure and a couple of commands, and each one is a pattern real apps run on every request.
  • Caches
    Answer from memory instead of a slow database or API, and let stale data expire by itself.
  • Leaderboards
    Sorted sets keep millions of scores in order. Ranks and top 10s in microseconds.
  • Counters
    Views, likes and stock levels that never lose an update, however many servers write.
  • Rate limits
    Stop brute force and API abuse with two commands and a timer.
  • Live updates
    Push events to every connected client the moment they happen, with pub/sub.
  • Sessions and tokens
    Keys that delete themselves: logins, one-time codes and carts that time out.

Pick your language

The same game, with a complete, tested program for every level.
Redis and Valkey tutorial for Node.js
With iovalkey. Needs Node.js 18 or newer.
Redis and Valkey tutorial for Python
With valkey-py. Needs Python 3.9 or newer.
Redis and Valkey tutorial for Go
With go-redis. Needs Go 1.22 or newer.
Redis and Valkey tutorial for Java
With Jedis. Needs Java 21 or newer and Maven.

Questions

Play it for real, for free

Sign up with Google or GitHub, create a Starter instance in under a minute, and run every level against it.

© 2026 KVNest · Managed Redis and Valkey, hosted in the EU

Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. KVNest is not affiliated with or endorsed by Redis Ltd.