title: Database Trigger Usage - Best Practices
body: <p><strong>Brief Background:</strong></p>
  
  <p>I currently maintain a fifteen year old inventory management system. In an effort to provide real-time quantity on hand for both single items and kits (possibly nested down to the Nth level), inventory is allocated to orders on the fly when a page is requested (allocation priority is determined by date received and date expected). Depending on how many orders are in the system, and more specifically, how many of those orders contain nested kits, performance can be an issue.</p>
  
  <p><strong>The Question(s):</strong></p>
  
  <p>We're currently in the process of designing a new inventory management system using SOA principles. Instead of allocating the inventory on the fly, we would like an allocation table to be updated after every insert, update, and delete occurs that could affect the items allocation data. There is some debate as to whether the allocation table should be updated by triggers in the DB, or by the C# order service.</p>
  
  <ul>
  <li>Which method would best adhere to SOA principles?</li>
  <li>Which method would be more performant?</li>
  <li>Is this the proper use of a trigger?</li>
  <li>Is either method generally accepted by the community at large as the "proper way to do things"?</li>
  </ul>
  
  <p>Thanks in advance for your time!</p>