title: Distributed Window Service
body: <p>I have a Class Library which runs inside a windows service. This library has long running threads to poll email (which could be broken out into tasks), handle messages, etc and works well. </p>
  
  <p>This is part of a product which needs to scale out by adding nodes. I currently define what customers are handled by a single node. </p>
  
  <p>My problem comes if that node goes down, or needs maintenance, manual intervention is needed and data is lost during the downtime. I'd like to come up with a solution that allows it to work like load balanced web servers. If a node goes down, the application can see that and act appropriately.  </p>
  
  <p>This is built on C# / .NET and MS SQL Server and would like to stick with those technologies.</p>
  
  <p>I realize this may not be as straight forward as my question seems, but I'm looking for any design patterns or best practices that might be out there to help me build out a solution. </p>