开发者

Designing an account statement

开发者 https://www.devze.com 2023-04-12 02:06 出处:网络
I have a mySQl innodb database which has a couple of tables which store different kind of transactions of a user. In order to show a custom \'Account Statement\', I have to fetch data from all of thes

I have a mySQl innodb database which has a couple of tables which store different kind of transactions of a user. In order to show a custom 'Account Statement', I have to fetch data from all of these tables every time a user wishes to see the Account Statement.

I am not sure what would be an optimized approach. There are a lot of users (and the data keeps changing in real time) and I'm not sure if I should keep caching the sql queries.

Should I create views that combine the table a开发者_运维知识库nd keep updating it whenever there is an update to the parent table?

Should I perform a join on these multiple tables each time a user requests for the account statement?

I was not able to find out if there is a standard design/practice for showing account statement (with pagination). Any suggestions?

Thank you.


I would recommend to start to create a JPA mapping of your tables and then using some "standard" provider (eg. Hibernate) to access your data. This will makes transparent access from Java to your data without thinking (too much) about views, etc.

Your scenario seems very common and is exactly what RDBMS are for. Do not hesitate for performance now, when going to start your first project (if it is not your first project, this question has no sense).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号