Hazelcast Caching for Clusterd Spring Application

邮差的信 提交于 2019-12-20 07:28:27

问题


We recently clusterd our Spring application with 2 nodes backed by one database. Our application has Dynamic menu(each user has different menu options), since we dont have enough caching in place every time user logs we hit the database and filter the Menu options based on user security. We want to avoid hitting the database each time user logs in by introducing Cache.

I was reading about hazelcast cache http://hazelcast.org/use-cases/caching/ and I noticed multiple options available for caching like In-Memory Data Grid/NoSql, Jcache and Spring Cache but not really sure which one is the best solution to cache the Menu items(String type). From my understanding I felt Spring Cache is the correct solution for my use case, if not please suggest me other hazelcast caching options.


回答1:


Spring Caching supports Hazelcast (or Hazelcast provides integration with Spring Caching :) ). If you use Spring 4 and higher, you can use JCache caching support from Spring Framework. You can find examples of usage here. Look for spring-* projects.

Spring Boot also supported. Watch the webinar recording, read my blog post, find code samples here.

Let me know if you have any questions.

Thank you



来源:https://stackoverflow.com/questions/38227033/hazelcast-caching-for-clusterd-spring-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!