On Mon, Jul 11, 2016 at 4:41 AM, <[email protected]> wrote:

> Hi,
>
> We've been using InfluxDB for some time now, although there are some
> differences in how we are structuring data.
>
> One approach is to take each measurement as a top-level entity, so then
> the series would be:
>
> {
>     "results": [
>         {
>             "series": [
>                 {
>                     "columns": [
>                         "key"
>                     ],
>                     "values": [
>                         [
>                             "cache_hit,host=foo,region=eu-west-1"
>                         ],
>                         [
>                             "cache_miss,host=foo,region=eu-west-1"
>                         ],
>                         [
>                             "response_time_x,host=foo,region=eu-west-1"
>                         ]
>                     ]
>                 }
>             ]
>         }
>     ]
> }
>
> ...so each measurement is at the top-level.
>

With this schema, you cannot do math between response_time, cache_miss, or
cache_hit. All series within a measurement can be queried and processed
together, but it is not possible to JOIN or MERGE between measurements.

Your query possibilities would be significantly constrained with this
schema.


> However, another approach is to group them in a top-level series and have
> multiple keys for each measurement. So, the series would be:
>
> {
>     "results": [
>         {
>             "series": [
>                 {
>                     "columns": [
>                         "key"
>                     ],
>                     "values": [
>                         [
>                             "cache"
>                         ],
>                         [
>                             "timing"
>                         ]
>                     ]
>                 }
>             ]
>         }
>     ]
> }
>
> ...and the measurements for cache operations would be within 'cache' and
> all for timings would be in 'timing'. Therefore the field keys would be:
>
> {
>     "results": [
>         {
>             "series": [
>                 {
>                     "name": "cache",
>                     "columns": [
>                         "fieldKey"
>                     ],
>                     "values": [
>                         [
>                             "hit"
>                         ],
>                         [
>                             "miss"
>                         ]
>                     ]
>                 },
>                 {
>                     "name": "timing",
>                     "columns": [
>                         "fieldKey"
>                     ],
>                     "values": [
>                         [
>                             "response_time_x"
>                         ]
>                     ]
>                 }
>             ]
>         }
>     ]
> }
>
>
This would keep related series together under the same measurement.


>
> I know how we'd approach it if we were saving this data into a relational
> database, but which is the most 'InfluxDB' way of doing it? Are there any
> performance trade-offs to having things organised in different ways?
>

I recommend the Schema Design webinar on
https://influxdata.com/videos-training/, and also the Performance Tuning
Tips from https://influxdata.com/technical-papers/



>
> Thanks,
>
> Beth
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/influxdb/b3a70104-1244-4e54-a547-90f36ff095bd%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvORWPxj6iHJkrC09iFPftEP7P%2BGQkyJLMKdZHD6-EOFiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to