I am going to write a simple credit system in which the user can " add ", " subtract " loans in the system. I am currently thinking of two approaches.
Simple: save the user's credit as balance in the database, and all actions ("add", "subtract") are recorded, but are not used to calculate the last balance.
The story is based: Do not store the balance in the database. Balance is calculated by viewing transaction history, for example. (add, subtract)
Both cases will work, I think, but I am looking to see if it is worth interfering with the development of such a system, especially I prefer the History based system.
Or, is there any open source implementation or module that I use?
Update. Or is there any Ruby / Rail-based module like AuthLogic , so I can connect and play my existing code without reinventing the wheel (e.g. transaction, rollback, security, etc.)?
ruby design-patterns ruby-on-rails database-design software-design
Ryan
source share