Learnitweb

Author: Editorial Team

  • Working with Redis Increment and Decrement Commands using Redisson

    In this section, we will explore how to work with increment and decrement operations in Redis using the Redisson Java client library. Until now, we have mostly been storing simple string values or Java objects in Redis. But Redis also supports numeric operations, allowing us to increment or decrement numeric values directly on the server…

  • Storing and Retrieving Java Objects in Redis

    So far, we have learned how to store and retrieve simple key-value pairs (strings) in Redis using Redisson. In this tutorial, we’ll go one step further and explore how to store entire Java objects in Redis.This is an essential concept because, in real-world applications, we often work with structured data — not just plain strings.…

  • Setting and Managing Key Expiration in Redis

    In this lecture, we will explore how to set an expiration time (or TTL — Time To Live) for a key in Redis. We will also see how to extend the expiry and how to retrieve the remaining lifetime of a key programmatically. 1. Setting Expiration for a Key So far, we have been creating…

  • Working with Redis Serialization and Codecs in Tests

    In the previous lecture, we successfully created our first Redis test using a simple key-value pair. Hopefully, that exercise felt straightforward and intuitive. Now, before we move on, let’s explore something important related to how Redis stores and retrieves data — serialization and codecs. Understanding the Redis Documentation Redis provides excellent official documentation that covers…

  • Working with Simple Key-Value Pairs in Redis using Redisson (Reactive Mode)

    In the previous tutorials, we successfully configured Redisson and created a reusable base test setup.Now, let’s move forward and interact with Redis by creating a simple key-value example using Redisson Reactive Client. This will help us understand how to store and retrieve basic data from Redis in a reactive, non-blocking way. 1. Objective In this…

  • Connecting to Redis Using Redisson in Java (Programmatic Configuration)

    In this tutorial, we will learn how to create a Redis connection using Redisson, one of the most widely used Redis clients in the Java ecosystem.We will configure Redisson programmatically (without YAML or configuration files) and understand how to work in single-server mode. Later, you can easily extend this to master-slave or cluster modes. 1.…

  • Setting Up a Maven Project for a Redis Playground

    In this tutorial, we will set up a Maven-based Java project to experiment with Redis using Redisson or similar libraries. This project will serve as a playground for testing Redis operations, reactive programming, and distributed data structures. 1. Prerequisites Before starting, ensure you have the following installed: 2. Creating the Maven Project 3. Configuring the…

  • Redisson: A Comprehensive Tutorial

    Redisson is a high-level Java client library for Redis that provides distributed data structures and services on top of Redis. Unlike basic Redis clients, Redisson offers Java-like abstractions such as maps, sets, lists, locks, and more, making it easier to integrate Redis into scalable, distributed Java applications. 1. Introduction to Redis Java Libraries There are…

  • Redis Persistence: Saving and Restoring Data

    Redis is an in-memory database, which means all data resides in RAM for fast access. However, memory is volatile, so if Redis is restarted, all data is lost unless it is persisted to disk. Redis provides mechanisms to save the current state and restore it later, ensuring that your application can continue from a known…

  • Redis Single-Threaded Execution and Transactions with Multi-Terminal Simulation

    Redis is single-threaded for command execution, which provides atomicity at the command level. However, when multiple commands are executed together, or when multiple clients perform operations simultaneously, race conditions may occur. Redis provides transactions and the WATCH command to handle these cases safely. 1. Single-Threaded Execution in Redis Example Without Transactions Two keys in Redis:…