Redis Exercises

This collection of hands-on exercises is designed to solidify understanding of Redis. Each challenge presents a practical, real-world scenario, allowing for the application of knowledge in Redis data structures, commands, and best practices. Working through these problems builds confidence and proficiency in using Redis for caching, session management, and real-time analytics. The exercises are structured to progressively develop skills, from basic commands to more complex application logic.

Installation and Initial Setup of Redis

Installation and Initial Setup of Redis

In this lab, you will learn how to install and perform the initial setup of Redis on a LabEx VM. The lab covers essential steps to get Redis up and running, including verifying the installation and ensuring the server is accessible. You'll update packages, install Redis, and test connectivity.
LabRedis
Basic Key-Value Operations in Redis

Basic Key-Value Operations in Redis

In this lab, we will explore basic key-value operations in Redis, focusing on how to interact with Redis as a data store. We'll use the `redis-cli` command-line interface to connect to the Redis server and perform fundamental operations. We will learn how to set and retrieve key-value pairs using the `SET` and `GET` commands. Furthermore, we will practice setting different key-value pairs to solidify our understanding of these core operations.
LabRedis
Introduction to Redis Data Structures

Introduction to Redis Data Structures

In this lab, you will explore fundamental Redis data structures and how to interact with them using the `redis-cli` command-line tool. The lab focuses on practical exercises to help you understand how to store and retrieve data in Redis. You'll work with Strings, Lists, Sets, and Hashes.
LabRedis
Redis Advanced Key Management

Redis Advanced Key Management

In this lab, you will explore advanced key management techniques in Redis. You'll learn to rename keys with RENAME, move keys between databases with MOVE, set multiple keys with MSET, retrieve multiple keys with MGET, and iterate keys efficiently with SCAN.
LabRedis
Redis Hash Operations

Redis Hash Operations

In this lab, we will explore Redis Hash operations, focusing on efficient ways to manage data within hashes. We'll cover HMSET, HMGET, HINCRBY, and HEXISTS. By the end, you'll understand common hash operations in Redis.
LabRedis
Redis List Operations

Redis List Operations

In this lab, you will explore fundamental Redis list operations. You'll learn to manage list data using commands like `LTRIM`, `LINSERT`, `LPOP`, `RPOP`, and `BLPOP`. Practice trimming lists, inserting elements, popping elements, and blocking until elements are available. Master Redis list management!
LabRedis
Redis Set Operations

Redis Set Operations

In this lab, you will explore Redis set operations, focusing on manipulating unordered collections of unique strings. You'll learn how to add elements to a set using the `SADD` command, perform set unions with `SUNION`, find common elements using `SINTER`, and identify differences between sets with `SDIFF`. Finally, you'll learn how to store the results of set operations for later use.
LabRedis
Redis Sorted Set Operations

Redis Sorted Set Operations

In this lab, you will explore fundamental Redis Sorted Set operations. You'll use ZADD to add elements, ZRANGE to fetch ranges, ZRANK to get element rank, ZINCRBY to increment scores, and ZREM to remove elements. Learn to manage sorted sets effectively.
LabRedis
Verify Redis Server Status

Verify Redis Server Status

In this challenge, you'll troubleshoot a Redis server connectivity issue by verifying its status. The task involves using the `redis-cli` command to connect to the Redis server and then using the `PING` command to confirm that the server is running and responsive.
ChallengeRedis
Expire Keys In Redis Cache

Expire Keys In Redis Cache

In this challenge, you'll simulate a social media app using Redis to cache trending topics. The goal is to set a key representing a trending topic and configure it to expire after a specific duration. You'll use redis-cli, set the key `trending:topic1` to `Redis Basics`, and set its expiration time to 3600 seconds.
ChallengeRedis