- 1 Getting Started: The World of In-Memory Data The "Why" Before the "How": What is Redis and Why Use It?Installing and Running Redis Locally or via DockerYour First Redis Commands: Navigating the Redis CLIUnderstanding In-Memory vs. Disk-Based Databases
- 2 Redis Fundamentals: Mastering Strings and Numbers Setting and Getting Values: The Basics of Key-Value StorageManaging Counters: INCR and DECR OperationsWorking with Multiple Strings: MSET and MGETModifying Strings: Appending and Substring Operations
- 3 Data Modeling Basics: Organizing Data with Hashes Introduction to Hashes: Storing Objects in RedisSetting and Retrieving Hash Fields: HSET and HGETManaging Multiple Fields: HMSET and HGETALLIncrementing Values Inside Hashes
- 4 Sequence Matters: Lists for Stacks and Queues Introduction to Redis Lists: Ordered Collections of StringsPushing and Popping Elements: LPUSH, RPUSH, LPOP, RPOPBuilding a Background Job QueueTrimming Lists to Keep Them Small: LTRIM
- 5 Uniqueness and Math: Working with Sets Introduction to Sets: Ensuring Unique ElementsAdding, Removing, and Checking Members: SADD, SREM, SISMEMBERSet Mathematics: Intersections, Unions, and DifferencesPractical Use Cases: Tagging Systems and Social Graphs
- 6 Ranking Data: Sorted Sets and Leaderboards Introduction to Sorted Sets: Adding Scores to Your DataAdding and Updating Elements with Scores: ZADDQuerying Ranges and Rankings: ZRANGE and ZREVRANGEPractical Use Case: Creating a Real-time Gaming Leaderboard
- 7 Memory Management: Keys, Expiration, and Eviction Time to Live (TTL): Setting Expiration on KeysMaking Keys Permanent or Checking Lifespans: PERSIST and TTLUnderstanding Redis Memory LimitsEviction Policies: How Redis Decides What to Delete (LRU vs LFU)
- 8 Beyond Basics: Specialized Data Structures Bitmaps: Ultra-efficient Boolean Storage (e.g., Daily Active Users)HyperLogLog: Approximating Unique Items with Tiny MemoryGeospatial Indexes: Storing and Querying CoordinatesFinding Nearby Locations using GEOSEARCH
- 9 Real-time Messaging: The Pub/Sub Paradigm The Publisher/Subscriber Pattern ExplainedSending Messages: The PUBLISH CommandListening for Messages: SUBSCRIBE and PSUBSCRIBELimitations of Pub/Sub: Fire-and-Forget Messaging
- 10 Robust Event Processing: Redis Streams Introduction to Streams: The Modern Append-only LogAdding and Reading Entries: XADD and XREADUnderstanding Consumer Groups for Work DistributionAcknowledging Messages and Handling Failures
- 11 Atomic Operations: Transactions and Lua Scripting Redis Transactions: Using MULTI, EXEC, and DISCARDOptimistic Locking with the WATCH CommandIntroduction to Server-side Lua ScriptingWhy Lua Scripts Provide Perfect Atomicity
- 12 Data Durability: Persistence Mechanisms The Persistence Dilemma: Speed vs. DurabilityRDB (Redis Database): Point-in-Time SnapshotsAOF (Append Only File): Logging Every Write OperationChoosing the Right Persistence Strategy for Your Application
- 13 Scaling Out: Replication, Sentinel, and Cluster Primary-Replica Replication: Scaling Read OperationsRedis Sentinel: Automated Failover and High AvailabilityRedis Cluster: Scaling Writes and Sharding DataUnderstanding Hash Slots in a Redis Cluster
- 14 Going Live: Security, Monitoring, and Administration Securing Your Instance: Passwords and the AUTH CommandRedis ACLs (Access Control Lists): Fine-Grained PermissionsRenaming or Disabling Dangerous CommandsMonitoring Performance: INFO, MONITOR, and SLOWLOG
- 15 Architectural Patterns: Redis in the Wild The Cache-Aside Pattern: Speeding Up Database QueriesImplementing Robust Rate LimitingManaging Distributed User SessionsCreating Distributed Locks for Microservices