An open API service indexing awesome lists of open source software.

https://github.com/devbigboy/redis-workshop

Redis Course - In-Memory Database Tutorial
https://github.com/devbigboy/redis-workshop

reids

Last synced: 4 months ago
JSON representation

Redis Course - In-Memory Database Tutorial

Awesome Lists containing this project

README

          

# Redis Workshop

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.

## Workshop Overview

### Workshop Goals

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.

### Prerequisites

To follow along with this workshop, participants should have a basic understanding of:

- Databases (especially NoSQL databases)
- Basic command-line usage
- Fundamental programming concepts

### Topics Covered

1. **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

2. **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.

3. **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

4. **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

5. **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

6. **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

7. **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

8. **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

9. **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

10. **Redis Security and Best Practices**
- Configuring Redis security settings (authentication, access control)
- Common pitfalls and how to avoid them
- Securing Redis in production environments

11. **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

12. **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.

## Workshop Schedule

| 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 |

## Resources

- **Redis Documentation**: [https://redis.io/documentation](https://redis.io/documentation)
- **Redis Commands**: [https://redis.io/commands](https://redis.io/commands)
- **Redis GitHub Repository**: [https://github.com/redis/redis](https://github.com/redis/redis)

## Youtube Videos

- **Redis بالعربي**: [https://www.youtube.com/playlist?list=PLZd2bo_SbAm_ijqLfnx94qkmytbWjUQ-h](https://www.youtube.com/playlist?list=PLZd2bo_SbAm_ijqLfnx94qkmytbWjUQ-h)

---

### Getting Started

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!