Search code examples
distributed-computingpartitioninghazelcastin-memory-database

Best practices on Hazelcast persistance and multiple members


I went through several related topics here and it seems the topic is still open, official documentation does not cover it so here we are.

  • There's a cluster with N members in one group
  • There's one distributed map
  • The map has persistence store backed up by MongoDB
  • Number of backups is 1
  • Write-through is enabled
  • Map is supposed to be populated at startup
  • Data in DB is too big to be stored solely by one member

The questions are:

  1. To make write operations working correctly, all map members have to have MapStore enabled, as they write only partitions they own?
  2. When cluster is starting, should loadKeys() implementation load only subset of data, or it should try to load entire data set and Hazelcast partitioning will take care of keys distribution?
  3. If both scenarios from previous Q are valid, which one is more efficient?

Solution

    1. Yes all members MUST have the MapStore implementation enabled
    2. No, it has to load all the keys (at least those you want to make available eagerly) and the loading node distributes the keys based on the standard distributed hashing pattern
    3. I guess this question is not necessary anymore, or maybe I misunderstood