Search code examples
javahazelcastdistributed-caching

hazelcast writing to 2 cache from 1 mapstore


I have some data in the database I want to read into 2 cache:
1. Entire json representing row of data
2. Just a subset of columns for quick querying purposes

I have a MapStore for persistence to the first cache with the json. I am thinking of using an EntryListener on the main json cache so when we add a value there, the entry listener will then write to the other cache. Does this approach sound like a good way to do it?


Solution

  • As I understand you have the second map just for querying purposes. You can use Indexes or even a Continuous Query Cache on the first map and not have a second map at all.