0
votes

A web application has 4 types of users. I want to track the response time of each type of user.

  • Solution 1 : Create a measurement with tag of user type which gives me a cardinality of 4.

  • Solution 2: Create a table for each type of user which creates also a cardinality of 4 (one coming from each table).

Supposing I am not interested on comping the data of the users. So issuing multiple queries on influxdb is not a problem.

What is the outcome of each solution in terms of performance, storage and memory? Which one is the influxdb way?

1

1 Answers

1
votes

go with solution 1:

https://docs.influxdata.com/influxdb/v1.6/concepts/schema_and_data_layout/#don-t-encode-data-in-measurement-names

Don’t encode data in measurement names

In general, taking this step will simplify your queries. InfluxDB queries merge data that fall within the same measurement; it’s better to differentiate data with tags than with detailed measurement names.