Multi-tenant Applications

Build multi-tenant applications with Graphlit.

Graphlit supports multi-tenant applications out of the box.

When creating your JWT, you can add the additional claim x-graphlit-owner-id, which is a foreign key reference to a user or organization in your application.

The value assigned to the x-graphlit-owner-id claim must be in UUID format.

The owner ID must be unique within a project, so your users' data is kept separate.

You can define how you want to map this ID for your specific use case. If your application supports individual users, this would be a unique user ID, or if your application groups users into organizations or tenants, this would be a unique organization (or tenant) ID.

This allows you to partition the content in your project by your application's users. We don't store any other information about your users, and use this owner ID as a way to partition data in the Graphlit project.

When using multi-tenancy, content that is ingested into the project directly is shared to each tenant.

For example, if you ingest a document using a JWT with no owner ID assigned (i.e. project-scoped), that document will be included in content query results when using any JWT with an owner ID assigned (i.e. tenant-scoped).

Tenants are not able to edit or delete project-scoped content.

Last updated