Answer the question
In order to leave comments, you need to log in
What is the best way to store a graph with a large number of values?
Hello, how can I store a graph with a large number of values for each record in a mysql table?
There were options:
- Drive into an array, run through serialize, save to the database
- Create a large number of fields in the table and store values in these fields
Tasks: periodically update fields, about 186 fields for 1 record (while shifting data by 1 field back, and add the last one with a new value), there are a lot of records (this is the problem. more than 1000 records).
PS: both options seemed too loaded, googling yielded nothing.
Please suggest other options (if any).
Answer the question
In order to leave comments, you need to log in
For monitoring, I would advise Graphite, there are ready-made interfaces for visualizing the accumulated statistics. You can retrieve data from the storage in json format, and you can request it already in an aggregated form.
Why not use a second table for this with a foreign key to the first and a many-to-one relationship?
In general, more specialized databases are suitable for this, but without details it is difficult to advise something.
serialize of course. A large number of fields is a very non-expandable solution
To store data in time, you can use ring (cyclic) databases , such as rrdtool.
Thanks to everyone, after all, we decided to use JSON for such purposes (it seems that the load turned out to be not so huge)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question