title: Handle duplication when application polling in cloud
body: <p>We have a scenario that we need to check after some interval that whether all the results are completed/processed in db against a particular id or not, and if it is then we need to make a file and send it to some bucket.</p>
  <p>This logic is written in spring application. Now the problem is I have a concern that once we deploy that application to cloud than if there are 10 instances running of an application then there is a chance that the file could be placed multiple times on the bucket.</p>
  <p>I don't want to implement something outside of an application (but open to any suggestion if it's not possible). May be using some db flags could help but I think that is not right or messy as all instances would be processing something before checking  at the end that the file is already processed.</p>
  <p>Please let me know on this. Thanks!</p>
  <p>P.S. I am using Spring, Mongodb, and GCP as cloud provider.</p>