hands-on lab

Managing a Redis Instance Using Google Cloud Memorystore

Difficulty: Beginner
Duration: Up to 55 minutes
Students: 435
Rating: 4.3/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Because new applications require to be reliable and super fast, caching is one of the solutions you should implement in an application to guarantee no time is spent without any reason. Suppose you are serving an application that serves images stored on a database, and suppose you have thousands of images stored on this database. On each request, you should perform a DB query that can take some time to be executed. Instead of always performing queries on the DB, you can set a middle-level caching system, where you store the most recent requested images. So, if a new request for one of these images is made, you first try to perform a query on the caching system, which is faster than the DB. If the image is here (cache hit), you send back to the user; if not (cache miss), you then perform a DB query. This is basically one of the most common scenarios when using a caching system. A caching system is a small and super fast in-memory store that lets you build caching solutions to avoid spending time performing useless queries on a DB.

Because of this importance, Google offers an in-memory caching solution through Google Memorystore. It is a scalable, secure, and highly available in-memory service for both Redis and Memcached. Redis is an in-memory caching system that allows you to store and retrieve structured data.

In this lab, you will use Google Memorystore to create a Redis instance, you will connect to it and perform some operations, and you will learn how to scale it up.

Learning Objectives

Upon completion of this lab you will be able to:

  • Create a Redis instance
  • Connect to a Redis instance and perform caching operations
  • Scale out a Redis instance

Intended Audience

This lab is intended for:

  • Google Professional Data Engineer (PDA) certification candidates
  • Solutions Architects who want to build and manage an in-memory caching solution
  • Developers who need to set a caching middleware between their applications and databases

Prerequisites

Basic Redis prerequisites are preferred but not required.

Updates

May 29th, 2024 - Updated lab to use Debian 12

January 25th, 2022 - Updated the instructions and screenshots to reflect the latest UI

Environment before

Environment after

Covered topics

Lab steps

Signing In to the Google Cloud Console
Creating a Google Memorystore Redis Instance
Connecting and Performing Operations to the Redis Instance
Scaling the Memorystore Redis Instance