Logto's multi-tenancy model explained
Take a look at how we designed Logto's multi-tenancy model and the benefits it brings to SaaS apps.
Take a look at how we designed Logto's multi-tenancy model and the benefits it brings to SaaS apps.
You may have heard of some products that use the term "multi-tenancy" to represent the identity isolation: each tenant has its own set of users, roles, permissions, and data.
It may be counterintuitive, but in fact, "multi-tenancy" indicates the contrary: multiple tenants are sharing resources in a single instance. To users, an identity in an app is like a driver's license. For example, with one driver's license, you can drive in different states (one identity for multiple organizations), instead of applying for a new driver's license for each state.
At Logto, we noticed this confusion at the beginning of our design, and we urged to make it right for your apps and your users. Here's our design:
This model provides the flexibility and reusability for managing identities, especially for SaaS apps. If we take a look at some popular SaaS apps, we can find that they can all fit into this model. The term "organization" may be different in different apps, such as "workspace", "team", etc. But the concept is the same.
For example, in Notion (a popular collaboration tool):
Hence, users can easily switch between workspaces without switching accounts or re-signing in, and it keeps the isolation between workspaces. Translate this to Logto's model, it means:
According to different roles, a user can have different permissions in different workspaces (organizations).
For users, they can enjoy the true single sign-on experience. Switching between organizations is as easy as switching between tabs.
One advantage of SaaS apps is that they are standardized and scalable. For example, you can create a new workspace in Notion with a few clicks, and it is ready to use.
When your app is growing, you may want to add more roles and permissions to each organization. For example, a new role "guest" and a new permission "invite:guest". It can be a nightmare if you need to update all existing organizations one by one.
With Logto, you can update the organization template, and all existing organizations will be updated automatically.
In Logto, we use the same access control model (RBAC) for both organizations and API resources. It means that you don't need to learn a new access control model if you are familiar with RBAC. Meanwhile, they are isolated from each other, so you can use them for different use cases.
The most exciting part is that you can use them at the same time. Let's extend the Notion example:
Most of Logto SDKs support both types of RBAC.
The differences
Organization RBAC and API resource RBAC are different in the following aspects:
Building a SaaS app is hard, and we hope Logto can help you focus on your core business. Don't hesitate to give us feedback if you have any questions or suggestions.