165. Cloud Memorystore for Redis

165.1 Spring Caching

Cloud Memorystore for Redis provides a fully managed in-memory data store service. Cloud Memorystore is compatible with the Redis protocol, allowing easy integration with Spring Caching.

All you have to do is create a Cloud Memorystore instance and use its IP address in application.properties file as spring.redis.host property value. Everything else is exactly the same as setting up redis-backed Spring caching.


Memorystore instances and your application instances have to be located in the same region.

In short, the following dependencies are needed:


And then you can use org.springframework.cache.annotation.Cacheable annotation for methods you’d like to be cached.

public String hello(@PathVariable String name) {

If you are interested in a detailed how-to guide, please check Spring Boot Caching using Cloud Memorystore codelab.

Cloud Memorystore documentation can be found here.