V
V
Vitaly Kuznetsov2015-06-26 18:46:25
PHP
Vitaly Kuznetsov, 2015-06-26 18:46:25

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

6 answer(s)
A
Artem Moseev, 2015-06-26
@D3fault_Player

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.

S
Stanislav Makarov, 2015-06-26
@Nipheris

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.

P
Pavel Gogolinsky, 2015-06-26
@gogolinsky

serialize of course. A large number of fields is a very non-expandable solution

C
ColdSpirit, 2015-06-26
@ColdSpirit

Record in blob format?

R
Roman Mirilaczvili, 2015-06-26
@2ord

To store data in time, you can use ring (cyclic) databases , such as rrdtool.

V
Vitaly Kuznetsov, 2015-06-27
@D3fault_Player

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 question

Ask a Question

731 491 924 answers to any question