Hazelcast Caching for Clusterd Spring Application

2019-03-04 00:42发布

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条回答
趁早两清
2楼-- · 2019-03-04 01:10

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

查看更多
登录 后发表回答