title: Scalable ASP.NET application jobs synchronization
body: <p>My ASP.NET app can run <em>on multiple virtual servers</em> (e.g. in Azure I can scale on demand). I'm not sure where I will host my app, whether it will be Azure or some other hosting service, but I faced with the following problem: <br><strong>I need to run jobs on some schedule</strong>: get exchange rates and they should be available for all server instances, check database and send emails, manage app cache or logs or do some other jobs in background. <br>
  What I don't understand well is how to build/architecture the system so that <strong>those jobs are executed only once</strong> (<em>I don't want to pull exchange rates on every app instance or send emails more than once</em>). So simple use cases of some Quartz.NET or QueueBackgroundWorkItem don't suit me.<br>
  I know that <strong>Azure WebJobs</strong> is capable of doing such things, but I do want the solution that <strong>doesn't not depend on hosting service</strong> like Azure, because maybe tomorrow I will want to move to another hosting service. <br></p>
  
  <ul>
  <li><strong>Is there any generic solution for this kind of problem?</strong></li>
  <li><strong>Can I build this using service bus that is not related to any hosting service?</strong></li>
  <li><strong>What are the advantages of using Azure specific solution (WebJobs, Azure ServiceBus) instead of generic solutions?</strong></li>
  <li><strong>What are the best practices to build this part of application so I can replace it in a quick way using DI? Just abstract away the service bus using interfaces or something else should be done?</strong></li>
  </ul>
  
  <p>Thanks.</p>