Memorystore Redis
Memorystore Redis Instance
Enable API
Enabling this API may take a few minutes.
Create an Instance
Create an instance and attach it to the default VPC.
Creating a Redis instance may take a few minutes.
Get Instance IP Address
The IP address is not a static IP address. If you create the instance, the IP address may be different.
Connect to Instance
See Memorystore connectivity options to see how to connect to a Memorystore instance from different computing environments.
Computing Environment
Compute Engine
Kubernetes Engine
App Engine Flexible
App Engine Standard
Cloud Run
Cloud Function
You can test quickly by creating a Compute Engine instance in a zone within the same region:
SSH into the machine:
Install redis-cli
:
Connect to the instance:
You can try different Redis commands, for example:
See redis-cli documentation for more information.
Spring Boot Cache
Spring Boot can use Redis to cache with annotations.
Dependency
Add the Spring Data Redis starter:
Configuration
Configure the Redis instance to connect to:
Enable Caching
Turn on caching capability explicitly with the @EnableCaching
annotation:
Cacheable
Once you configured the Spring Boot with Redis and enabled caching, you can use the @Cacheable
annotation to cache return values.
Spring Boot Session
Spring Boot can use Redis for session data with Spring Session Data Redis.
Dependency
Add the Spring Data Spanner starter:
Configuration
Configure the Redis instance to connect to:
Enable HTTP Session
Turn on caching capability explicitly with the @EnableSpringHttpSession
annotation:
Samples
Last updated