NAZEHA
NAZEHA

Reputation: 455

Using cache with spring boot and redis embeded

I want to use spring boot with caching data retrieved from rest web service. I propose to use redis for caching data. Is it possible to use embeded redis with spring boot without installing a redis software? If yes with which version of spring boot and how to do it?

Thanks for your responses.

Upvotes: 0

Views: 1094

Answers (2)

Andrei Maimas
Andrei Maimas

Reputation: 695

Hazelcast supports the scenario you are trying to implement. It has a concept of embedded cache that can be shared/synchronized across the service nodes.

For more details see:

Upvotes: 0

Chao Jiang
Chao Jiang

Reputation: 503

Redis can't meet your request.

You can of course simply use embedded EhCache within your Spring Boot application. If you want to share the cache, it depends on your architecture. You could expose REST endpoints to make you cache available to other applications.

You can refer: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-cache.

Spring have annotation @EnableCaching to enable or disable cache. Also, there are four annotations like @Cacheable and @CacheEvict to custom the cache logic.

Upvotes: 1

Related Questions