Hi. So I’m working on a multi-tenant iot-system.
Each tenant can have several sensors. Each sensor can produce different metrics at a different velocity.
I want the tenants to be able to have different retention periods based not only on device but also on the metric type.
At first I was going to make different hyper tables with different retention periods and then insert data from a device into a table fitting the desired retention.
It became complicated. Now I’m working on a - so far - durable setup, where each tenant have a set of hyper tables under a schema name matching the tenant id.
Each metric for each device has it’s own hyper table with a unique name (UUID). A separate and global table keeps track of table names, tenants, devices, metrics, and retention periods for each hyper table.
That way I can quickly dump a table for a device metric and a tenant if the table is no longer relevant. I can also change the retention time for a specific device-metric if the tenant wishes.
I think the above makes sense but I’m also a bit worried, that I might be missing something. Any inputs/thoughts would be much appreciated.