FreeHostia Forums
https://forum.freehostia.com/

How to store fast-changing data in MySQL?
https://forum.freehostia.com/viewtopic.php?f=7&t=66156
Page 1 of 1

Author:  EleanorW [ Wed Jun 02, 2021 8:29 am ]
Post subject:  How to store fast-changing data in MySQL?

I want to store a date/time and total asset price (adding all stock holdings together) in MySQL for graphing purposes. I want to store data every five minutes when the market is open to show a 1-day chart, and the last traded price for all 1 week, 1 month, 3 months, and 1 year. However, I am confused about how I should design tables for it. Here are some of my ideas:

Make two tables for each user. One for 1-day chart data, and the other for the rest chart data. However, the 1-day chart should be able to be of deque structure since I just want 24-hour data, so adding new data should delete the oldest data.

I should just make one table with two diff columns, one for 1D chart data, and the other for the rest. The goal is to serialize data and store it, which I believe is not an ideal way to go.

Any pointers would be helpful.

Author:  N_Harris [ Thu Jun 03, 2021 5:07 am ]
Post subject:  Re: How to store fast-changing data in MySQL?

Assuming that I understood you correctly, you need advise for application development (or in this case the database structure) - this thread in stackoverflow.com might be a useful starting reference: https://stackoverflow.com/questions/125 ... nformation

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/