I’m developing inventory management software. Currently I’m researching ways to ensure its impossible to have negative supplies. Given the simplest transactions types like: increase items count for a given item for a given warehouse, reduce it and transfer from one warehouse to another. And the possibility for a user to create, delete and update those transactions, including dates, items lists, quantities and warehouses – I can see no other way rather than on each change to recalculate entire set of transactions for given items+warehouses. However it is obviously not a scalable way to manage this.
What are the best practices here? Is it possible to handle this synchronously on each update? Please, point me to articles, best practices or other resources to dive deeper into this topic. All I can find mostly relates to how those systems should behave from business point of view and not from software architecture
I was looking for open source implementations but the only popular thing is ERPNext which has comprehensive documentation but only for businesses willing to adapt it and not for developers to build on top