Creating Multiple Tables Dynamically in PostgreSQL

Viewed 37

I'm seeking for a solution for a time-series database that will hold measurement data of IoT devices used by multiple tenants.

Each tenant have their own device types that sends different measurement data (for example pressure, temperature, etc.)

After some research I arrived an SQL solution with TimeScaleDB for postgreSQL and dynamically creating a new SQL table for each device type - each with it's own set of columns.

Assuming I might have 1000 tenants, each with a few device types, is it a good design to have a database with thousands of tables?

As far as I understand, postgreSQL has a limitation of 8KB page size - so even in minimal cases where only 1 device is sending data for a month, I will most probably exceed that - which is a good thing for the multi-table design.

Thanks.

0 Answers
Related