cube icon indicating copy to clipboard operation
cube copied to clipboard

Multi tenancy in single database with different app ids

Open scerdal opened this issue 8 months ago • 0 comments

Problem

Hello, I have a multi tenant setup in a single database. The docs recommend using row level filters to achieve multi-tenancy in this situation, but I'm wondering what the pros/cons of generating different data models for each tenant would be instead of injecting row level filters.

Related Cube.js schema

const {
    securityContext: {clientId}
} = COMPILE_CONTEXT;

cube(`orders`, {
    sql: `SELECT * from orders where client_id = ${clientId}`,
....
})

scerdal avatar Jun 06 '24 13:06 scerdal