Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Can payload cms supports for multi-tenant architecture with multiple mongoDB dbs ?

default discord avatar
veera267 months ago
5

Any body knows, Using payload cms



1. How to access the data from multiple dbs through cms ?


2. How to switch the dbs at runtime ?

  • default discord avatar
    richadrlast year
  • default discord avatar
    presecanlast year

    I would like to know that as well. If you find out some solution, please let me know

  • default discord avatar
    taun2160last year

    Anyone know how to create custom sub-domains eg tenant1.app.com ?

  • discord user avatar
    dribbens
    last year

    Multiple database connections from a single payload instance is not currently supported.


    This could be an enhancement we address in a later version, but we might never do it.



    Your best experience is going to be to run one large DB instance. If you need tenant isolation then you should treat each tenant as a separate instances of node + DB per tenant.



    Consider that any relationships are going to be broken if one collection is located in one DB while another is housed somewhere else.


    Multi collection queries won't be possible, my brain is exploding thinking about how this would even work.

  • default discord avatar
    kapyl8 months ago
    @969226489549713438

    , Logical Segregation in multi-tenancy sometimes a must, it would be a huge achievement for PayloadCMS if it backs it. Shifting that complexity over infra is a huge cost.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.