Reduce the DB workload by moving the Procedure to Hazelcast (reading from Map or alternatively get form DB)

38 Views Asked by At

I am new to HazelCast. Our team is currently having a heavy load on the DB due to the massive amount of Procedure will be called every second and we are having a transition plan to move those Procedure to Hazelcast.

Background of one of my use case:

  1. We need to settle our transaction (which include a lot of calculation in between) every minute and there is a chance re-settle is required when the Input entered is wrong.
  2. Currently we are having one pipeline to work on the Settle's use case. All the settled transaction done in Hazelcast will be wrote to a Map and also write to the DB. (The writing to the DB logic is done in the same pipeline)

Questions:

  1. For my resttle case, I'm planning to read the existing result from the Map (by BatchStage and filter with the Transaction ID) and if there is no result then only I will get the result from the DB. I'm having some trouble here on checking whether there is any result in the Batch Stage and get the result from the DB if necessary. Can I have some example of handling with this kind of scenario?

  2. Is my current design is sticking with the Hazelcast Behavior? I understand that Hazelcast behavior is more towards stream processing, I'm not too sure if the part writing the result to a Map and DB in a single Pipeline is correct or not. Hope that I can get some advice from you if possible.

Thanks!

Regards, KZ

0

There are 0 best solutions below