impress icon indicating copy to clipboard operation
impress copied to clipboard

Multi-tenancy

Open Pom4H opened this issue 3 years ago • 1 comments

First of all I want to thank you for this great contribution to the Node.js community!

I want to implement on the impress an SaaS application with a multi-tenant architecture. But the question arose: How can I isolate the session context of users, and domain services from different tenant domains?

The first step is to split database connections using different accounts, or connect to different databases. Also, I wanted to leverage the hot reload capabilities of the api and domain to call isolated tenant-specific endpoints and domain methods without restarting the entire application. Using stored procedures in the database or folded into a special folder. For example:

/tenant/1/api
/tenant/1/domain
/tenant/2/domain

But default /api and /domain can be common.

P.S. I asked this question in the last meetup)

Pom4H avatar Apr 15 '21 20:04 Pom4H

What I want to come to:

Have a read-only general schema. And to make it possible for the tenant to supplement it with properties and methods of business logic. Using the visual editor in the admin panel, create business process diagrams, make javascript out of this, or deploy it in some other way (not so important). Then, by introspection on the client, receive the modified schema at run-time

It is important that you cannot get the methods of the module from another tenant, and access them from the context.

Pom4H avatar Apr 16 '21 07:04 Pom4H