Redis Implementation for Database Operations in Spring Boot

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
# Redis Config
spring.redis.host=localhost
spring.redis.port=6379
spring.cache.type=redis //set application cache type to redis
spring.cache.redis.time-to-live=60000 //cache expiration time in miliseconds
spring.cache.redis.cache-null-values=false //allow redis to cache null values
spring.cache.redis.use-key-prefix=true //to enable prefix in cache key name
spring.cache.redis.key-prefix=My Cache: //key name prefix

References

--

--

--

A curious software developer who loves to write.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Static Program Analysis: Its Usage And Limits

Algorithmic trading system for stocks

Kubernetes — let’s get you started!

Data Exploration in Python for SAS Programmers(Part 2)

What Can I Do When HUAWEI IAP Cannot Be Launched?

Azure DevOps Introduction — Create your first tasks (part 2)

The Supportive Cycle (v1.0)

Understanding the Basics of Cloud Database

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alexander Ang

Alexander Ang

A curious software developer who loves to write.

More from Medium

Distributed micro-services using Spring Cloud — Service Discovery — Part 1

Spring Security, Powered by MSAL Part 2 (Resource Server)

Your guide to a MicroService architecture, building your first microservice using spring boot and…

React & Spring Boot Hateoas Driven Fullstack Application on Kubernetes