Design Secure Embedded Analytics With Row Level Security
Last updated: November 29, 2026
Quick Overview
A SaaS company wants to embed Sigma dashboards inside its own product so each of its customers sees only its own rows. Design the embedding flow, including how the host app authenticates its users, how identity and attributes reach Sigma, and how those attributes restrict queries.
Sigma Computing
November 29, 20260
0
0 solved
A SaaS company wants to embed Sigma dashboards inside its own product so each of its customers sees only its own rows. Design the embedding flow, including how the host app authenticates its users, how identity and attributes reach Sigma, and how those attributes restrict queries.
Embedding is a major Sigma use case, and it fails in the worst way (one tenant seeing another's data) if security is wrong. Interviewers check signed embed tokens, short expiry, attribute-driven row filters enforced on the server, and caching that never leaks across tenants.
What the Interviewer Expects
- Have the host app's backend, not the browser, sign an embed request with a shared secret
- Include user id, tenant attributes, allowed workbook and a short expiry in the signed payload
- Enforce row-level security by injecting predicates into generated SQL on the server
- Scope result caches by security attributes
- Prevent replay and tampering (nonce, expiry, signature over all parameters)
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you rotate the embed secret without breaking live sessions?
- What changes if some tenants need column-level masking, not just row filters?
- How do you let an embedded user save a personal copy of a dashboard safely?
- How would you audit which tenant saw which data?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
The host app shows an iframe with a dashboard. The end user never logs in to Sigma directly. Each viewer sees only rows for their tenant (and maybe their region). Tokens must not be forgeable or reusa...
High-Level Design
- The user loads a page in the host app.
- The host backend builds an embed URL with parameters: workbook id, external user id, user attributes like
tenant_id = 42, a nonce, andexpires_ata few...