I'm currently working on a farming IoT system and confused about the architecture so I wanted to get your views.
I'm using a relational DB (PosgreSQL).
I have multiple customers, each customer has one or more farmhouse and each farmhouse has one or more field. I have IoT devices on each field, from a few to 200 hundred which communicates with backend each second.
I have multiple options how to architect this system.
Subdomain and server per customer which will have their own database (logical db's on single instance), schema per farmhouse and a table for keeping fields. So when I want to get devices on certain field, I only need to do a inner join with fields and devices and filter.
No subdomains, schema per customer and table for farmhouses and fields. Then I need to create association between farmhouse and field, and use this composite key to select the field and then make inner join on field_id.
Single schema, I need to have a table for customers, farmhouses and fields. I need to associate customers with farmhouses, farmhouses with fields and select devices on fields with composite key of customer, farmhouse and field.
I'm quite junior on architectural design so I can't tell which one of these makes more sense.