"should the user's account balance be stored in the database or calculated dynamically?" Code Answer

2

in order to keep accurate auditing you should make record of every transaction that affects the users account balance. this means you can calculate the balance dynamically, however for performance reasons i would have the balance stored as well. to ensure the balance is correct though, i would have a daily job run that recalculates the balance from scratch.

By vmx on September 26 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.