cube-js / cube-js/cube

Multi tenancy in single database with different app ids

Open
#8,331 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**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**
```javascript
const {
securityContext: {clientId}
} = COMPILE_CONTEXT;

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.