should the user's Account balance be stored in the database or calculated dynamically?

Viewed 3645

Should the user's Account balance be stored in the database or calculated dynamically?

For accurate results calculating it dynamically make sense but then it might be a problem, when there are many user's and the database grows very large?

Transaction

  • Id (PK)
  • AccountId
  • Type
  • DateTime
  • Amount
  • etc..etc...

AccountBalance

  • TransactionId (PK/FK)
  • BalanceAmount
5 Answers
Related