Best way to maintain a customer's account balance

前端 未结 8 630
孤独总比滥情好
孤独总比滥情好 2021-02-06 10:24

Is it better to have a field in the database that stores the customers account balance or use views and queries to generate the information.

8条回答
  •  醉话见心
    2021-02-06 11:20

    If views and queries give you fast enough result then do not store in a separate field.

    If it's not fast enough then store it into a separate field. Since this field will store redundant information it is very important to keep it synchronized.

提交回复
热议问题