0

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.

asked Feb 20, 2018 at 21:34
2
  • 1
    There's no such thing? All the embedded redis frameworks are for integration test. Use an in-memory solution for caching there are some more verbose like Ehcache that could be used if you want more caching control like TTL. Commented Feb 20, 2018 at 21:47
  • Thanks Darren! So with Ehcache, it is possible to use cache without installing any software. and i want to know if ehcache offer the possibilty to enable and disable cache? Commented Feb 21, 2018 at 5:48

2 Answers 2

1

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.

answered Feb 21, 2018 at 8:33
Sign up to request clarification or add additional context in comments.

Comments

0

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:

answered Dec 8, 2020 at 19:31

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.