ssuhat's avatar

Need advice for database table

Hi,

Right now I'm building an ecommerce site and there will be statistics using Laravel and MariaDB.

My question is: Right now I have Transactions and Transaction Summary table. Every time transaction is made I will save to those tables.

Do I really need Transaction Summary tables to increase my speed when load statistics page (I don't need to SUM all the transactions amount)?

Thanks.

0 likes
5 replies
ssuhat's avatar

@AkiyamaSmart Hi, thanks for rep. What do you think is better, save the table when there is transaction or every midnight run a cronjob to summarize (each product) all today transaction?.

InaniELHoussain's avatar

do you need to get the data(sum) refreshed all the time if so then I guess its after each transiction but if you are not interested in showing new data untill the next day then the Planified tasks are convenient.

ssuhat's avatar

@AkiyamaSmart So far I query using Laravel it always result -1 day. So today transaction won't be shown.

InaniELHoussain's avatar
Level 32

it all depends on what you want to show, if you HAVE to show current data I'd recomand update it everytime you make new transiction, otherwise use Cronjob

Please or to participate in this conversation.