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

D as Diagramming: From Sandwich to Containers

Key Reasons You Should Prefer Flutter App Development in 2022

Sidekiq Tutorial & Overview: Is Sidekiq For Ruby Still Worth Working With After 10 Years?

Adding a burst laser powerup

Docker 101: Fundamentals & The Dockerfile

Testing the Fuse Spark Testnet

How to implement Retrofit Basic Authentication in Android (Kotlin)

Task 2 :-

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

Microservices #Circuit Breaker

Testing Schema Registry with Spring Boot and Spring Kafka using MockSchemaRegistryClient

Drools — Drive your rules from database

Introduction to the Hexagonal Architecture in Java | Design Pattern