Y
Y
Yuri Shchekochikhin2013-01-29 08:42:55
Database
Yuri Shchekochikhin, 2013-01-29 08:42:55

How to store time series?

There are many data sources. We can say that the data from them comes in the form - <measurement date, value, attributes in the form of a map>. Moreover, these attributes change both from source to source, and from measurement to measurement.
There are many measurements and they need to be stored and statistically processed.
Which DBMS is better to choose?
Are there ready-made services?
UPD:
As an example, store http requests, temperature sensor readings, the position of the application in the play market.
Format - well, the path is at least json. { 'timestamp': '', 'value':'', {… }}
UPD2: there is a lot of data.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
abir_valg, 2016-04-11
@amage

Here they advise the DBMS of the object-relational model.
Those. PostgreSQL.
Mongo was advised because it has scaling out of the box?
And so I ask myself this question.

V
Violetdrug, 2013-01-29
@Violetdrug

If there is a lot of data, then it is better to use Mongo, it does not slow down when it grows.
If within reason, then MySql
For MySQL, I recommend the following scheme:
Each line corresponds to one device, the data is stored in a full-text field in the form
{ 'timestamp': '', 'value':'', {… }},{ 'timestamp' : '', 'value':'', {… }},{ 'timestamp': '', 'value':'', {… }}
,
$query="INSERT INTO `bd`.`table` ( `json`,`keyid`) VALUES ("{ \"timestamp\": \"\", \"value\":'', {… }}', '".$keyid."')". " ON DUPLICATE KEY"." UPDATE `json` =CONCAT(`json`,',{ \"timestamp\": \"\", \"value\":'', {… }}'), keyid='".$keyid."'" ;
… .
And when you request
$res="{'hist':[".row['json']."]}"; $poll=json_decode($res);
$poll->hist from the database, the data set itself
will appear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question