Answer the question
In order to leave comments, you need to log in
How to organize the storage of currency quotes in the database?
Hello! Now the task is to collect data on the quotes of a certain currency every second (let there be bitcoin). Based on these data, it will be necessary to build graphs of changes for the last hour/day/week/month, etc.
How to store the received data? At the moment I see a table with fields datetime for the timestamp and rate for the value. The question is, will MySQL pull such a load if there are, for example, 1000 such currencies? That is, a thousand new records will be added every second. Or are there more specific/rational solutions for such purposes? If so, please kick in which direction to dig. Thank you!
Answer the question
In order to leave comments, you need to log in
https://en.wikipedia.org/wiki/Time_series_database
Mysql can write 1000 rows per second. Reading a monthly chart (2.5 million points for a quote alone) can be quite expensive
Write down the delta , if the delta is zero, then don’t write at all, I saved 30% of the space occupied by the database and, accordingly, the required processing speed, when outputting, the query is just a little more complicated!
Well, if with regards to your parameters, which = 1000:
Another problem of premature optimization)))
You will not have 1000 currencies!
And you will not have 1000 updates per second!
Your parameters are similar to a typical average Korean stock exchange, of which there are under two hundred, but there are no more than 70 currencies and a lard turnover per month , how many per second xs, do you have exactly the same project ?? and you ask HERE??)))!
Round Robin Database: RRDtool.
They effectively store the aggregation of metrics over time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question