cube
cube copied to clipboard
Multi tenancy in single database with different app ids
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}`,
....
})