Skip to content

Glossary

RLS — Row Level Security

A database policy that ensures each query only sees the rows it is allowed to — typically scoped to an organisation or user.

What does it mean?

RLS (Row Level Security) is a Postgres feature that filters rows automatically based on policies you define. The application does not have to remember `WHERE org_id = …` in every query — the database enforces it.

In multi-tenant SaaS, RLS is often the last line of defence: even if a bug forgets a filter in code, customer A’s data does not leak to customer B.

When it matters

  • Multi-tenant products

    When many organisations share one database and isolation must not be optional.

  • Customer portals

    When external users see orders, documents, or tickets — and mistakes are expensive.

  • Compliance and due diligence

    When you must explain how data is isolated — not only trust application code.

  • A growing engineering team

    When more developers touch queries and manual WHERE filters become a risk.

Short answers

  • Is RLS the same as roles in the app?

    No. App roles control what the UI allows. RLS controls what the database returns at all — even if the code fails.

  • Can we start without RLS?

    For an early prototype with few users: sometimes. Before paying customers with sensitive data: no — it is more expensive to cut in later.

  • Does it only work in Postgres?

    RLS as a concept is strongest in Postgres. Other databases have similar patterns, but we typically build on Postgres + RLS.

Need data isolation done right?

Let’s review your tenant model.

We look at queries, policies, and risks — without selling unnecessary complexity.