This question is not about "programming" (does not apply to any language or database), but also about design and architecture. This is also a question like "What is the best way to make X." I hope this does not cause much "religious" controversy.
In the past, I developed systems that somehow preserve some form of inventory of items (it is not appropriate which items). Some use languages โโ/ databases that do not support transactions. In those cases, I decided not to save the number of items at hand in the field in the position record. Instead, a quantity is calculated for the total amount of inventory โ the total number of stocks sold. Because of the software, there were practically no discrepancies in the inventory. Tables are properly indexed and performance is good. There is an archiving process if the number of records begins to affect performance.
Now, a few years ago, I started working for this company, and I inherited a system that tracks inventory. But the quantity is stored in the field. When a record is registered, the received quantity is added to the quantity field for the item. When an item is sold, the amount is deducted. This led to discrepancies. In my opinion, this is the wrong approach, but previous programmers swear here.
I would like to know if there is consensus as to what the correct way is to design such a system. Also, what resources are available, printed, or online to get recommendations on this.
thank
design database inventory
nmarmol Nov 13 '08 at 14:38 2008-11-13 14:38
source share