Distributed Synchronized Background Jobs ASP Core

Problem:- In the age of containerized apps, running multiple instances, and Kubernetes, sometimes you face a situation where you want to run a background jobs in the ASP Core, but you have multiple instances of application running on Kubernetes for example, so you will end up with duplicated running background jobs equal to the number of running application instances (e.g. same background job runs for each application instance) Solution :- Easy and straight forward : separate the background jobs into a new solution and deploy one instance of it (100% confidence of running one instance) Do a synchronization mechanism to allow only one instance runs jobs ( not 100% confidence of running one instance) We will talk about second solution:- We need to start jobs at different times, not at the same time, so, we can synchronize work (e.g. one job-instance start with the smallest time and the others in a different times). We need a "centralized store" to store the ...