Learn Redis
Use an in-memory data store for caching, queues and leaderboards.
Free to start. Built from a single prompt. No credit card.
Redis is an in-memory data store that keeps data in RAM, which makes reads and writes very fast. It is more than a key-value cache: values can be strings, hashes, lists, sets, sorted sets and streams, each with its own commands. Developers use it to cache database results, store sessions, rate-limit APIs, run job queues and power leaderboards with sorted sets. Keys can expire automatically with a time-to-live, and data can be persisted to disk with snapshots or an append-only file. Open-source forks like Valkey share the same commands. Learnr builds a personalized Redis course with short, hands-on lessons.
How to learn Redis, step by step
- Run Redis and explore redis-cli. Start Redis with Docker or a package manager and open redis-cli. Try SET, GET, DEL, EXISTS and KEYS on a test instance, and learn why KEYS should never run on a busy production server.
- Learn expiry and atomic counters. Use SET with the EX option and TTL to watch keys vanish. Build a page-view counter with INCR, which is atomic, and see why that matters when many clients write at once.
- Pick the right data structure. Store a user profile in a hash, a recent-activity feed in a list trimmed with LTRIM, unique visitors in a set and a game leaderboard in a sorted set with ZADD and ZRANGE.
- Cache database queries from an app. Connect from Node.js or Python, check Redis before querying the database and store results with a TTL. Decide how to invalidate the cache when the underlying data changes.
- Build a rate limiter and a simple queue. Limit API calls per user per minute with INCR and EXPIRE, then push jobs onto a list or stream for a worker to process. These two patterns appear in many production systems.
- Study persistence and memory limits. Compare RDB snapshots with the append-only file, and set maxmemory with an eviction policy. Brief Learnr lessons help keep the many commands sorted by data type.
What you'll learn
- Use redis-cli to set, get, increment and expire keys
- Choose the right data type for a problem
- Implement caching with time-to-live and invalidation
- Build a leaderboard with sorted sets and a rate limiter with INCR
- Explain persistence, pub/sub and streams
What's inside your Redis course
A sample path Learnr builds for Redis. Your real course adapts to your goal and level.
- 1. What Redis is and running redis-cli
- 2. Strings, keys and expiration
- 3. Hashes, lists and sets
- 4. Sorted sets and common patterns
- 5. Caching strategies and app integration
- 6. Persistence, pub/sub, streams and scaling
How long does it take to learn Redis?
You can learn the core commands and data types in 1 to 2 weeks at a few hours a week. Using Redis well in applications, with caching strategy and failure handling, typically takes 1 to 2 months of building.
What you need before you start
Basic programming and some experience with a database or web backend. Knowing why caching helps makes the patterns more meaningful.
Common mistakes to avoid
- Using Redis as the only copy of important data without understanding persistence settings. Configure snapshots or AOF, or keep the source of truth elsewhere.
- Caching without expiry or invalidation, so users see stale data indefinitely. Set a TTL and clear keys when the source data changes.
- Storing huge values or running slow commands like KEYS on large datasets. Redis is single-threaded for commands, so one slow call blocks others.
How Learnr builds your course
Type your topic
Tell Learnr you want to learn Redis, or get as specific as you like.
Get a personalized course
Learnr instantly builds a full Redis course tailored to your goal and skill level.
Learn and level up
Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.
Redis questions, answered
Is Redis a database or a cache?
Both. Many teams use it as a cache in front of another database, but with persistence enabled it can serve as a primary store for data that fits in memory.
What is Valkey?
Valkey is an open-source fork of Redis started in 2024 after Redis changed its license. It is compatible with Redis commands, so the skills transfer directly.
Explore more courses
More programming and tech courses
- Learn Terraform
- Learn DevOps
- Learn Microservices
- Learn Web Accessibility
- Learn Ethical Hacking
- Learn Assembly Language
- Learn Embedded Systems
- Learn Arduino
See all programming and tech courses
Ready to learn Redis?
Start your free, personalized Redis course in seconds. .