Multiple variables in one field

Hi,

Is it possible to store many variables in one field, so there will be only one timestamp? Or there must be only one variable in one field?
I’m sending 2 floats per 10 seconds to database and I have 8GB SD card so I calculated that space will end in a 6 months. That’s short time.

You can have multiple fields in one measurement; they will all have the same timestamp. The Sample Data in the InfluxDB Key Concepts documentation uses points with two fields and two tags.

Additionally, InfluxDB does smart things to compress the data it stores. I’m not sure if that was taken into account in your calculations.

Generally, time series data is less valuable the older it gets. Many users will “downsample” their data; they will keep the last two weeks of data at 10 second resolution, for example, but for data older than that they might only keep data at a resolution of 1 minute.

Do you need 10s resolution for all of your data, forever? In that case, you should probably buy a bigger SD card :joy:

Otherwise, I recommend checking out our documentation on Downsampling and Data Retention.

@noahcrowley I can’t open “Downsampling and Data Retention” link. Could you send it one more time?

Yes, sorry about that: https://docs.influxdata.com/influxdb/v1.5/guides/downsampling_and_retention/

@noahcrowley ok, thank you. Can I store downsampled data in the same measurement and in the same field as new data?

1 Like

You’re going to want to store the downsampled data in a different retention policy (RP) from your default. That way, you can specify a shorter duration for incoming data compared to your downsampled data.

The downsampled data will have the same name and fields as the original data, but in order to access data in any RP other than default, you will need to specify the RP in your query, like so:

SELECT * FROM "mydata"."downsampled_data" LIMIT 5

Where downsampled_data is the name of the retention policy.