dimanche 28 avril 2019

Design pattern to limit access to a shared resource

Problem statement

At start up multiple machines will become online. There is a scheduler that will run on each of those machine. The scheduler will Fire every 5 minutes on each machine. There will he bunch of data to read from Cassandra. However only one machine must read those messages from Cassandra and must delete the messages after it’s done. It two or more machines read and process the data it will unnecessarily increase the load on the downstream system.

Possible solutions: Use zookeeper to implement a distributed lock. Perhaps make use of Leader election design pattern. Shared resource design pattern also work in the same way. Modified leaky bucket design pattern which can work with distributed application

Is there a design pattern which can be used to solve this problem?

Aucun commentaire:

Enregistrer un commentaire