# Influxdb suggested schema

**URL:** <https://discourse.nodered.org/t/influxdb-suggested-schema/6786>\
**Category:** General\
**Created:** [14 January 2019 12:08 UTC](https://discourse.nodered.org/t/influxdb-suggested-schema/6786 "2019-01-14T12:08:32Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [16 January 2019 16:42 UTC](https://discourse.nodered.org/t/influxdb-suggested-schema/6786/21 "2019-01-16T16:42:01Z")

</div>

> [@moebius](#):
>
> for downsampling you usually use another db with a longer retention policy

That is not at all what is described in the [how-to](https://docs.influxdata.com/influxdb/v1.7/guides/downsampling_and_retention/)...

They _do_ show writing the downsampled data to a new _measurement_ within the same database though. Different measurements within the same database can be set to use different retention policies; RPs are not database wide. There _is_ a default RP for each database but it's not mandatory to use it. You can query multiple measurements at once too.

 ![46%20AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/ca2fa4359593b659d79f86a4a7dd0f27601321b0.png)

We're getting _super_ into the weeds though.

---

<div class="post-metadata">

**Author:** ![moebius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moebius/32/2872_2.png) [@moebius](https://discourse.nodered.org/u/moebius)\
**Post date:** [16 January 2019 17:01 UTC](https://discourse.nodered.org/t/influxdb-suggested-schema/6786/22 "2019-01-16T17:01:19Z")

</div>

ic...thanks for clarifying!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 January 2019 14:50 UTC](https://discourse.nodered.org/t/influxdb-suggested-schema/6786/23 "2019-01-17T14:50:26Z")

</div>

> [@Paul-Reed](#):
>
> Do you use downsampling?
> 
> On one sensor, I get data every 5 seconds, so that's over 17,000 entries per day, which takes a lot of loading!

I restrict my sensors to report about once a minute. A couple do about every 30sec. So I keep that data in detail for 30 days. I have a second database that is a downsampling to hourly and I keep that indefinitely though I really need to trim it to a couple of years.

Your downsampled chart WILL include recent data but only averaged (or however you've downsampled) to the hour. It is true that you need separate charts though.

I think if I had a sensor reporting that fast, I'd directly downsample it. Depends on need of course. None of my environmental data needs data samples under a minute. I do have Raspberry Pi data down to a few seconds but that doesn't need keeping very long.

[Previous page](https://discourse.nodered.org/t/influxdb-suggested-schema/6786.md?page=1)
