Hey @florianmartens 👋

1.) The ability to annotate all queries for a model e. g. findOne find with an additional condition. In this case, a query like find() would automatically become findOne({ where: { tenantID } }) - this would allow isolation on the logic layer that is more robust than adding a filter condition to every query

I would suggest creating the feature request for this here with the above use case.

2.) The ability to pool database connections, allowing me to manage connections to many databases as well as run migrations with them.

For this, there is an on-going issue here and someone from the community has also created a library for that which you can check out.

🌐
Palo Alto Networks
docs.paloaltonetworks.com › prisma-access › administration › manage-multiple-tenants-in-prisma-access
Prisma Access Multi-Tenancy
May 11, 2026 - To allow you to create and manage multiple Prisma Access instances, Prisma Access offers multitenancy, which enables you to create up to 200 instances (tenants) on a single Panorama appliance (or 2 appliances in high availability (HA) mode), with each tenant having their own separate templates ...
🌐
npm
npmjs.com › package › prisma-multi-tenant
prisma-multi-tenant - npm
With a multi-tenant architecture, a software application is designed to provide every tenant a dedicated share of the instance - including its data, configuration, user management, tenant individual functionality and non-functional properties.
      » npm install prisma-multi-tenant
    
Published   Nov 01, 2020
Version   2.4.2
Author   Thibaud Courtoison
🌐
GitHub
github.com › Errorname › prisma-multi-tenant
GitHub - Errorname/prisma-multi-tenant: 🧭 Use Prisma as a multi-tenant provider for your application
Because prisma-multi-tenant does not only allow you to access multiple databases seamlessly with only a couple of lines of code in your server, but it also let you use the CLI to create new tenants and assure consistancy between all your databases ...
Starred by 400 users
Forked by 43 users
Languages   TypeScript 87.1% | JavaScript 12.3% | Shell 0.6%
🌐
ZenStack
zenstack.dev › blog › multi-tenant
Multi-Tenancy Implementation Approaches With Prisma and ZenStack | ZenStack
March 18, 2023 - There are two primary approaches to implementing multi-tenancy using relational databases, which are determined by whether there is physical isolation for data in the database. Each tenant will have its own database like the below: The idea behind it is quite straightforward. You need to have a separate instance of database client for each tenant database. For example, using Prisma and Nest.js, the code would be like this:
🌐
Prisma Cloud
docs.prismacloud.io › en › enterprise-edition › content-collections › multitenant-management › multitenant-management-introduction
Prisma Cloud Multitenant Management Overview
June 25, 2025 - Unlock the full potential of Prisma Cloud with our Content Collections. These comprehensive resources are your key to mastering the suite of functionality available on ...
Find elsewhere
🌐
Palo Alto Networks
docs.paloaltonetworks.com › prisma › prisma-access › prisma-access-panorama-admin › manage-multiple-tenants-in-prisma-access
Prisma Access Overview
Tenant Management · AIOps for NGFW · Cloud Management for NGFWs · Cloud NGFW for AWS · Cloud NGFW for Azure · CN-Series · Firewalls · PAN-OS · PAN-OS SD-WAN · Panorama · Service Provider · VM-Series · Plugins · Prisma Access · Prisma SASE Multitenant Platform ·
🌐
Palo Alto Networks
docs.paloaltonetworks.com › prisma-access › administration › manage-multiple-tenants-in-prisma-access › plan-your-multitenant-deployment
Plan Your Multitenant Deployment
May 11, 2026 - See Create an All-New Multitenant Deployment for more information. Make a note of your license allocation for remote networks and mobile users. Open your license (PanoramaLicenses) and find the Prisma Access Total Mbps (remote networks bandwidth pool) for remote networks and User Limit (total number of licensed users) for mobile users. When you create tenants, you assign resources for remote networks and mobile users from this license allocation.
🌐
Reddit
reddit.com › r/nestjs_framework › need help with multi tenancy and prisma
r/Nestjs_framework on Reddit: Need help with Multi tenancy and Prisma
July 9, 2024 -

One Database each table hat a id and tenant_id column.

For approximately 100 Tenants each tenant had about 2000 users.

I plan to Identify each tenant by header X-Tenant-Id: tenant1

I have found somethin about Durable provider in the NestJs docs: https://docs.nestjs.com/fundamentals/injection-scopes

But in there is a Hint that this strategy is not ideal for applications operating with a large number of tenants. What is a "large number of tenant" and what is the best alternative ?

Is there a best practice example for NestJs & Prisma Multi tenancy ?

For scaling I plan something like this, but is this a good idea ? Databse Server 1 with DB 1 and Tenant 1 - 10 with DB2 and Tenant 10-20 with DB 3 and Tenant 20-30

Databse Server 2 with DB 4 and Tenant 40-50 with DB 5 and Tenant 50-60 with DB 6 and Tenant 60-70

Databse Server 3 with DB 4 and Tenant 70-80 with DB 5 and Tenant 80-90 with DB 6 and Tenant 90-100

🌐
GitHub
github.com › Errorname › prisma-multi-tenant › blob › master › docs › Complete_Documentation.md
prisma-multi-tenant/docs/Complete_Documentation.md at master · Errorname/prisma-multi-tenant
However be careful, because you will need to manually migrate up and down this tenant after that. If you add the management argument, you can create a new management database. If you want to use this new management, don't forget to add the url in the prisma/.env file. ... prisma-multi-tenant studio your_tenant_name prisma-multi-tenant studio your_other_tenant --port=5556
Author   Errorname
🌐
Palo Alto Networks
docs.paloaltonetworks.com › prisma-access › administration › manage-multiple-tenants-in-prisma-access › multitenancy-configuration-overview
Multitenancy Configuration Overview
May 28, 2026 - You allocate licenses accordingly to each tenant when you enable multitenancy. If you have a license for remote networks and mobile users, you can set up an individual tenant with only mobile users or only remote networks. For each tenant you create after the first, Prisma Access automatically creates templates, template stacks, and device groups for each tenant and associates them to the access domain you create.
🌐
GitHub
github.com › sarang-tops › prisma-multi-tenant
GitHub - sarang-tops/prisma-multi-tenant: prisma-multi-tenant · GitHub
COMMANDS init Init multi-tenancy for your application list List all tenants new <management?> Create a new tenant or management studio <name> Use Studio to access a tenant migrate <name?> <action> Migrate tenants (up, down, save) delete <name> Delete one tenant generate Generate Prisma Clients for the tenants and management env <name> Set env variables for a specific tenant eject Eject prisma-multi-tenant from your application help Display this help OPTIONS -h, --help Output usage information for a command -V, --version Output the version number -e, --env Load env file given as parameter --ver
Author   sarang-tops
🌐
Darioielardi
darioielardi.dev › schema-based-multi-tenancy-with-nestjs-and-prisma
Schema-Based Multi-Tenancy with NestJS and Prisma
February 24, 2024 - It turned out to be a great decision, and I described our wonderful experience in a recent blog post. The project is an API backend for a multi-tenant system, where each tenant has its own schema in our Postgres database.
🌐
Mikealche
mikealche.com › software-development › how-to-create-a-multi-tenant-application-with-next-js-and-prisma
How to create a Multi-tenant application with Next.js and Prisma – Mike Alche
Now we should only need to create a map of domain names to tenants or —in our case— organizations. In your schema.prisma file add the following Domains model and link it with the Organization model.
🌐
Medium
medium.com › @mohantaankit2002 › implementing-multitenancy-in-nestjs-with-prisma-postgresql-bb4b177e7519
Implementing Multitenancy in NestJS with Prisma & PostgreSQL | by Ankit | Medium
October 28, 2024 - A multitenant architecture allows you to serve different tenants in one application without them seeing each other’s data — a crucial feature for SaaS businesses. In this post, let’s dive into creating a multitenant application using NestJS as our framework, Prisma as the ORM, and PostgreSQL as our database.
🌐
Prisma Cloud
docs.prismacloud.io › en › enterprise-edition › content-collections › multitenant-management › multitenant-management
Prisma Cloud Technical Documentation
Unlock the full potential of Prisma Cloud with our Content Collections. These comprehensive resources are your key to mastering the suite of functionality available on ...
🌐
Palo Alto Networks
docs.paloaltonetworks.com › prisma-access › administration › manage-multiple-tenants-in-prisma-access › enable-multitenancy-and-migrate-the-first-tenant
Enable Multitenancy and Migrate the First Tenant
While Prisma Access migrates your configuration to the first tenant, you need to specify: The Bandwidth to allocate for the tenant’s remote users deployment (if applicable). The Users to allocate for the tenant’s mobile users deployment (if applicable). The number of ADEM units to allocate for mobile uses and remote networks (if applicable). ... Select Enable Multitenancy (located on the upper right of the page).
🌐
Prisma
prisma.io › home › multiple databases › multiple databases › multiple databases
How to use Prisma ORM with multiple databases in a single app | Prisma Documentation
You will learn how to connect to two different Prisma Postgres databases, manage migrations, and deploy your application to Vercel. This approach is useful for multi-tenant applications or when you need to separate concerns when managing connections to multiple databases.