Welcome to the Redis Workshop! This workshop is designed to provide an in-depth understanding of Redis, a fast, in-memory data structure store widely used as a database, cache, and message broker. Redis is known for its flexibility, simplicity, and performance, making it an ideal tool for many applications.
By the end of this workshop, participants will be able to:
- Understand the core principles and use cases of Redis.
- Use various Redis data structures and commands.
- Build high-performance, real-time applications leveraging Redis.
- Implement Redis as a caching layer to improve application performance.
- Understand Redis' persistence, replication, and clustering capabilities.
To follow along with this workshop, participants should have a basic understanding of:
- Databases (especially NoSQL databases)
- Basic command-line usage
- Fundamental programming concepts
-
Introduction to Redis
- What is Redis?
- Key features and architecture
- Redis use cases: caching, session management, real-time analytics, pub/sub, etc.
- Redis data structures overview
-
Core Data Structures and Commands
- Strings: Set, Get, Append, Increment/Decrement, and String length operations.
- Lists: Pushing/popping elements, retrieving elements by index or range, using lists as queues/stacks.
- Sets: Adding, removing, checking membership, and performing set operations (union, intersection, difference).
- Hashes: Storing and accessing structured data, working with fields and values.
- Sorted Sets: Adding elements with scores, ranking, and retrieving ranges.
- Bitmaps and HyperLogLogs: Advanced data types for specific use cases.
-
Working with Expirations and TTL (Time to Live)
- Expiring keys automatically with TTL commands
- Using Redis as an ephemeral data store for sessions and caching
-
Redis Persistence
- Different persistence methods: RDB (snapshotting) and AOF (Append-Only File)
- Configuring Redis persistence for data durability
- Pros and cons of each persistence mode
-
Redis as a Cache
- Caching strategies with Redis
- Implementing caching in applications
- Key eviction policies (e.g., LRU, LFU, volatile, allkeys, no eviction)
- Use cases: session caching, database query caching, content caching
-
Redis Pub/Sub (Publish/Subscribe)
- Understanding the publish/subscribe messaging pattern
- Real-time messaging and communication with Pub/Sub
- Practical applications: chat systems, notification systems, and more
-
Redis Transactions and Atomicity
- Understanding transactions in Redis with MULTI, EXEC, WATCH, and DISCARD
- Using optimistic locking with WATCH for concurrency control
- Limitations of Redis transactions and workarounds
-
Replication and High Availability
- Configuring Redis replication for data redundancy
- Understanding master-slave architecture
- Automatic failover with Redis Sentinel
- Basics of Redis Cluster for horizontal scaling
-
Introduction to Redis Streams (Advanced)
- Overview of the Redis Stream data structure
- Stream commands: adding entries, reading entries, consumer groups
- Use cases: logging systems, event-driven architectures
-
Redis Security and Best Practices
- Configuring Redis security settings (authentication, access control)
- Common pitfalls and how to avoid them
- Securing Redis in production environments
-
Monitoring and Tuning Performance
- Monitoring Redis performance with built-in commands (INFO, MONITOR)
- Key metrics to watch: memory usage, command latency, keyspace hits/misses
- Configuring Redis for high performance and tuning common settings
-
Hands-On Exercises and Labs
- Each section will include practical exercises and labs to reinforce concepts.
- Real-world scenarios to apply Redis to caching, Pub/Sub messaging, and data storage.
| Topic | Duration |
|---|---|
| Introduction to Redis | 15 mins |
| Core Data Structures & Commands | 45 mins |
| Expirations & TTL | 15 mins |
| Redis Persistence | 20 mins |
| Redis as a Cache | 30 mins |
| Redis Pub/Sub | 30 mins |
| Transactions & Atomicity | 20 mins |
| Replication & High Availability | 30 mins |
| Redis Streams (Advanced) | 20 mins |
| Security and Best Practices | 15 mins |
| Monitoring & Tuning Performance | 20 mins |
| Hands-On Exercises & Labs | 1 hour |
- Redis Documentation: https://redis.io/documentation
- Redis Commands: https://redis.io/commands
- Redis GitHub Repository: https://github.com/redis/redis
Feel free to explore each topic at your own pace. We encourage participants to ask questions and experiment with different Redis commands throughout the workshop to gain a solid hands-on experience with Redis.
Let’s dive into Redis and discover the power of in-memory data storage!