
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Interact with the Redis cluster
/ 40
Enable persistence in the Redis cluster
/ 30
Scale out the Redis cluster
/ 30
Memorystore for Redis Cluster is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging this highly scalable, available, and secure service.
In this lab, you will interact with Memorystore for Redis Cluster on Google Cloud. You'll learn how to use Memorystore for caching, perform zero-downtime scaling, and enable data persistence.
In this lab, you will learn how to:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In this section, you will connect to the Redis cluster using a client application. We will run RedisSim to simulate load on the cluster. RedisSim is a command line tool to simulate various scenarios running against a Redis compatable cluster. The Redis client is running on the client VM deployed as part of the lab.
From the Navigation menu, select Compute Engine > VM instances.
Click on the SSH button next to the redis-client instance to open a terminal window.
Verify that the environment variables MEMORY_STORE_HOST
and MEMORY_STORE_PORT
are set correctly by running the following commands:
MEMORYSTORE_HOST
: The output should match the actual hostname or IP address where your Memorystore Redis Cluster is running.MEMORYSTORE_PORT
: The output should match the port number on which your Memorystore Redis Cluster is listening (typically 6379).Your output should be similar to the following:
Monitor the performance of the Redis cluster by navigating to the Memorystore page in the Google Cloud Console and selecting the redis-cluster instance.
Navigate to the Monitoring tab to view the performance metrics. You can view metrics like CPU Utilization
, Memory Utilization
, Received connections
, Cache hit ratio
, and Calls
.
In this section, you will use Redis commands like SET
, GET
, HSET
, HGET
to store and retrieve data.
Click Check my progress to verify the objective.
In this section, you will enable and disable persistence in the Redis cluster. Memorystore persistence ensures data durability in the event of unexpected outages or restarts. While high availability should protect the cluster from data loss in most scenarios, in some rare cases of cascading failures, having persistence would ensure a low RPO and protection of data.
From the Navigation menu, select Memorystore. Select the redis-cluster instance.
Under Configurations, next to Persistence click on the Edit button.
Select Append Only File (AOF) as the persistence mode, and use Every Second as the frequency. This setting determines how often Redis writes the AOF log to disk. While "Every Write" would provide the highest level of data safety (every change is immediately logged), it can impact performance due to the constant disk I/O. "Every Second" strikes a balance, offering frequent persistence while minimizing the performance overhead.
Click on Update Cluster. This could take up to 30 minutes to apply.
Click Check my progress to verify the objective.
Memorystore for Redis Cluster provides one click or one command scale-in or scale-out support. Google invested heavily in the engine, adding enhancements above and beyond what OSS Redis offers, to ensure that these scaling commands are non-disruptive and cause zero downtime.
Navigate to the SSH terminal window for the redis-client instance.
Run the following command to run RedisSim with 500 clients:
You will now scale out the Redis cluster to 10 shards while the RedisSim is running.
From the Navigation menu, select Memorystore. Select the redis-cluster instance.
Under Configurations, next to Shards, click on the Edit button.
10
and click on Update Cluster. This could take up to 30 minutes to apply.This demonstrates how you can easily scale out the Redis cluster to accommodate increased workloads while minimizing disruption to existing applications. If the load reduces in the future, you may scale in (reduce the number of shards) via the same interface to ensure that your cluster remains right-sized.
Click Check my progress to verify the objective.
Congratulations! In this lab, you explored Memorystore for Redis Cluster. You connected to the Redis cluster using a client application and performed basic operations like storing and retrieving data. You configured Redis data persistence to ensure durability in the event of unexpected outages or restarts. You scaled a Redis cluster to accommodate increased workloads while minimizing disruption to existing applications. You also scaled a Redis cluster to accommodate increased workloads without taking any downtime.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated March 31, 2025
Lab Last Tested July 18, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one