Managing User Data with Expiration

Welcome to the first step in building our Redis-based backend system. In this unit, we will focus on how to manage user data with expiration using Redis. This is a fundamental part of our project that will set the stage for more advanced features in later units.

What You'll Build

In this unit, we will implement two primary operations for managing user data using Go:

  1. Adding user data with an expiration time: This ensures that user data is stored only for a specified duration before being automatically deleted.
  2. Retrieving user data: This allows us to fetch the stored user data.

Here is a Go code example to help illustrate these operations:

In this example, Set is used to store user data with an expiration time, which is specified as 24*time.Hour to represent a duration of one day. The Get method is used to retrieve the stored data.

This foundational knowledge will prepare you for more complex tasks in upcoming lessons. Let's move on to practice implementing this logic to reinforce your understanding.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal