title: InfluxDB optimize storage for 2.7 billion series and more
body: <p>We're looking to migrate some data into InfluxDB. I'm working with InfluxDB 2.0 on a test server to determine the best way to stock our data.</p>
  <p>As of today, I have about 2.7 billion series to migrate to InfluxDB but that number will only go up.</p>
  <p>Here is the structure of the data I need to stock:</p>
  <ul>
  <li>ClientId (332 values as of today, string of 7 characters)</li>
  <li>Driver (int, 45k values as of today, will increase)</li>
  <li>Vehicle (int, 28k values as of today, will increase)</li>
  <li>Channel (100 values, should not increase, string of 40 characters)</li>
  <li>value of the channel (float, 1 value per channel/vehicle/driver/client at a given timestamp)</li>
  </ul>
  <p>At first, I thought of stocking my data this way:</p>
  <ul>
  <li>One bucket (as all data have the same data retention)</li>
  <li>Measurements = channels (so 100 kind of measurements are stocked)</li>
  <li>Tag Keys = ClientId</li>
  <li>Fields = Driver, Vehicle, Value of channel</li>
  </ul>
  <p>This gave me a cardinality of 1 * 100 * 332 * 3 = 99 600 according to this <a href="https://www.influxdata.com/blog/data-layout-and-schema-design-best-practices-for-influxdb/" rel="nofollow noreferrer">article</a></p>
  <p>But then I realized that InfluxDB handle <a href="https://docs.influxdata.com/influxdb/v2.0/write-data/best-practices/duplicate-points/" rel="nofollow noreferrer">duplicate</a> based on &quot;measurement name, tag set, and timestamp&quot;.</p>
  <p>So for my data, this will not work, as I need the duplicate to be based on ClientId, Channel, Vehicle at the minimum.</p>
  <p>But if I change my data structure to be stored this way:</p>
  <ul>
  <li>One bucket (as all data have the same data retention)</li>
  <li>Measurements = channels (so 100 kind of measurements are stocked)</li>
  <li>Tag Keys = ClientId, Vehicle</li>
  <li>Fields = Driver, Value of channel</li>
  </ul>
  <p>then I'll get a cardinality of 2 788 800 000.</p>
  <p>I understand that I need to keep cardinality as low as possible. (And ideally I would even need to be able to search by driver as well as by vehicle.)</p>
  <p>My questions are:</p>
  <ul>
  <li>If I split the data into different buckets (ex: 1 bucket per clientId), will it decrease my cardinality?</li>
  <li>What would be the best way to stock data for such a large amount of series?</li>
  </ul>