raulledo
1 week ago

How to run queries across multiple databases

Posted 1 week ago by raulledo

Hello,

I have a multi-tentant app with one "master" database to store all the common data (like a "customers" table that is shared across all tenants) and one database per tenant to store all the tenant related data (like a "orders" table with all the orders, only for that tenant).

Now I want to make some queries that needs data from all the tenants like this:

  • All the customers that have made more than 5 orders in total, across all tenants.
  • All the customers that have made more than 5 orders on al least one of the tenants.

Is that possible? how?

Thanks!

Please sign in or create an account to participate in this conversation.