0
votes

actually, I'm trying Hazelcast to provide a prototype for caching data. Hazelcast is deployed embedded in a spring-boot Microservice.

We are using distributed query for searching entries with partial values of the key.

Our infrastructure is at the moment only having the possibility to provide one instance of the microservice. The map is been persisted with a MapStore-implementation in a database.

If the microservice is shutdown, we lose all data in the memory and the distributed query does not return any results. Using loadAllKeys() etc. to initialize data in memory through the MapStore is not a way since we will have a lot of entries at the database to load.

As an interim solution, we lookup the database directly. It is surely not a best solution but it works for the moment. We Will like to have a right solution for it. Does anybody have an idea how to accomplish this?

Best

1
Why is the microservice being shutdown ?Neil Stevenson
It should support this use case because of some infrastructure conditions.Rubén

1 Answers

0
votes

If you shut your cluster down and use loadAllKeys() to repopulate, this will run as quickly as the database can handle. If that time is too long, that's because the database is too slow.

Finding a faster persistent store is the real answer, although reducing the number of outages will also help.

The latter requires design thought, for example portable objects allows the data in memory to change format without a reload.