Category: redis
-
Incrementing and Decrementing Values in Redis
In this lesson, we will learn how to increment (increase) and decrement (decrease) values in Redis. These commands are extremely useful for scenarios where you need to maintain counters, track visits, or update numerical data without manually reading and writing the values every time. Setting Up a Key Before incrementing or decrementing a value, you…
-
Checking for Key Existence in Redis
In the earlier lessons, we used the KEYS * command to list all the keys in our Redis database. While this approach works fine when you are experimenting or working with a small dataset, it becomes inefficient in real-world scenarios. Let’s now understand why that’s the case, and learn a more efficient way to check…
-
Redis SET Command Options: NX and XX
In this lecture, we will explore two important conditional options available with the SET command — NX and XX.These options allow you to control when a key should be created or updated, based on whether it already exists in the Redis database. 1. Basic SET Behavior Before we dive into the options, let’s recap the…
-
Redis Expiry and TTL (Time-To-Live)
In this session, we will explore one of Redis’s most powerful features — key expiration.Expiration allows Redis to automatically remove keys after a specified duration, so you don’t have to delete them manually.This feature is widely used in session management, caching, and temporary data handling in distributed applications. 1. Setting Expiry for Keys Redis allows…
-
Redis: Deleting Keys and Clearing Data
1. Introduction In the previous session, we learned how to retrieve all the keys stored in Redis. In this lecture, we’ll focus on another essential operation — deleting keys. Deleting keys is a simple but powerful operation. It allows you to remove unnecessary data, free up memory, or reset the database entirely when needed. Let’s…
-
Redis: Creating and Managing Simple Key-Value Pairs
1. Introduction In this section, we’ll understand the most fundamental concept in Redis — storing and retrieving key-value pairs. At its core, Redis is a key-value data store, meaning that every piece of data you store in Redis is associated with a key that uniquely identifies it. This is similar to how variables in programming…
-
Redis: Working with Simple Key-Value Pairs
1. Introduction In this lecture, we’ll explore the most fundamental concept in Redis — storing and retrieving key-value pairs.Redis is a key-value data store at its core, and everything you store in Redis is associated with a key that uniquely identifies the data. Redis supports several advanced data structures such as lists, sets, hashes, and…
-
Redis Installation and Setup (with Docker)
1. Introduction In this lecture, we’ll learn how to install and set up Redis, understand what happens during installation, and how to interact with the Redis server using the Redis CLI.We’ll also look at how to run Redis inside a Docker container, which is a very common and convenient setup for developers. 2. Installing Redis…
-
Redis: An Introduction
1. What is Redis? Redis (REmote DIctionary Server) is an open-source, in-memory data structure store used primarily as a database, cache, and message broker. It is designed for high performance, low latency, and real-time data processing. Redis stores data in memory instead of disk, which makes it extremely fast compared to traditional databases like MySQL…
