Neil Aggarwal wrote:
There are a few things we do:
- When we place an order, we commit the order to the database in a transaction.
- In a separate transaction, we reduce the qty available of the product by the amounts ordered. This transaction may be a conflict with other transactions. That is OK.
- The inventory management system keeps the master inventory of the products. We have a continuous job that pulls the latest updates to the inventory and feeds those updates back to the web database.
So, even if an inventory number is wrong for a short time, it will be updated to an accurate number soon.
that may be OK for an order processing system, but it could be a serious problem for something like a banking system where you are dispersing cash.