Multitenancy architecture inside a global ecosystem app

Hi @vishsahu ,

I’m working on building a multitenancy architecture within an ecosystem application. I don’t want the entire app to be multitenant; I only need that structure for the section where several companies manage separate operations from the tenant level down to the subtenant level.

I’ve installed the multitenancy plugin, but it seems to be enforcing that architecture across the entire ecosystem application. What is the best practice for a setup where we have organizations that, when selected, reveal their specific subtenants or branches? We need to see the operations within those subtenants and allow value builders to move between them, while ecosystem users maintain a global view unaffected by the multitenancy architecture. Essentially, we need to deliver different data to different organizations without locking the whole app down.

I initially tried a reference-based approach, but I ran into a limitation where a collection couldn’t effectively serve as both a parent and a child across different structures, which became a major bottleneck. Since managing these operations is critical for an ecosystem involving many initiatives, could you help me find the right path forward?

Rather than enabling the multitenancy plugin app-wide, scope tenancy to that module: keep a tenant/subtenant hierarchy in its own collection (tenant_id, parent_id, type), and attach records to the lowest node that owns them. Use role/context-based filters—global ecosystem users query without a tenant filter, while value builders switch an active org/branch context. For the parent/child limitation, avoid making one reference field do both jobs: use separate parent and child relations, or a join/closure table for ancestry. I’d first validate whether the plugin supports per-page or per-collection activation before changing the data model.

1 Like