1

Here is an example how start hazelcast without network. For my purpose it is needed to run hazelcast as embeded, only as simple cache. But original question was about testing - can I use that code for production when I do not need a separated hazelcast server?

Community
  • 1
  • 1
Cherry
  • 31,309
  • 66
  • 224
  • 364

1 Answers1

2

Hazelcast is designed to be a distributed system. It wasn't designed to be in-process cache. Because of distributed nature, may design decisions don't make it as a good candidate for your use case. You will see overhead on serialization and network (even in local single node embedded mode). We're planning to improve this situation by providing optimization for local cache use case but no ETA at this point. You will see some features related to this use case in next couple releases.

I would suggest taking a look on Caffeine. It has JCache and Spring Boot integration. I would suggest sticking to JCache integration because it will make your code portable. If in the future you decide to go distributed, you just need to replace caffeine jars with Hazelcast.

Feel free to ask if you have any questions.

Thank you

Vik Gamov
  • 5,446
  • 1
  • 26
  • 46
  • It seems that is not very easy to integrate `Caffeine` with Spring `3.1`. Could you suggest another cache library or do you know how integrate caffeine with Spring `3.1`? – Cherry Aug 10 '16 at 01:57
  • Are you using spring caching abstraction api? – Vik Gamov Aug 10 '16 at 01:58
  • 3.1? Wow, that's very old library, if you ask me. Spring 5 is scheduled for next year. Spring 4 was released 3 years ago? – Vik Gamov Aug 10 '16 at 02:01
  • Yep, but I have no choice, at the future I plan to use newer version but not right now :( – Cherry Aug 10 '16 at 02:02
  • Spring 3 doesn't have JCache support. But I believe you can use Google guava with spring 3. – Vik Gamov Aug 10 '16 at 02:04