influxdata / influxdb-java

Java client for InfluxDB
MIT License
1.18k stars 476 forks source link

Influxdb-java data model should have Series #483

Open lxhoan opened 6 years ago

lxhoan commented 6 years ago

In current influxdb-java data model we find all concepts of InfluxDB except Series (refer to https://docs.influxdata.com/influxdb/v1.6/concepts/key_concepts/).

Series is the core concept in any time series database. A time series DB design suggestion is don't have too many series, that means most of data points would belong to a certain series.

Nevertheless, a certain time data source (such as a weather censor, a surveillance camera ...), in my opinion, will be writing to a specific series only.

So it would be more convenient for user if we can have a Series in influxdb-java, and also fulfill the InfluxDB model from high level POV

One design I would like to propose is as follows

image

In this design, SeriesPoint extends Point and refers to Series, so all SeriesPoints belong to a Series can share the same tag set and retention policy. This way we can even save some overheads when generating line protocol string

lxhoan commented 6 years ago

@ivankudibal , what do you think on my proposal

lxhoan commented 6 years ago

Hi @dubsky , @bednar

Please help to take a look on this, in general I think we need this to fulfill the time series data model, my idea is more from technical POV. However, someone experienced in real customer use cases / data may give advice if it can benefit from customer POV

lxhoan commented 6 years ago

Hi @fmachado , please also help to raise your idea on this, thank you

bednar commented 6 years ago

I think it is a good improvement and add to the customers another option how use Java client. I see one problem... that is backward compatibility with existing Series Object.

lxhoan commented 6 years ago

except the naming, they are different objects. The QueryResult.Series has columns and values

QueryResult.Series is a projection (I use a relational DB term) of the merging of all series in a measurement