Log in Get a demo
All articles

Architecture 4 min read

Tenant isolation belongs in the access layer

Why every query for events must carry a tenant ID — and why that is not left to whoever writes a rule.

A desk by a window with a laptop, a lamp and a pen holder

A multi-tenant CRM keeps many client companies in one system, and so does the analysis behind it. The events of one tenant must never show up in the rules, reports or portal of another — not by design, and not by mistake.

The usual way to get this wrong is to make isolation a habit: every rule author remembers to add the tenant filter. It works until one rule, written in a hurry, forgets — and the mistake stays invisible until someone sees data that is not theirs.

The front of a wooden apartment house with many windows and a white off-road car parked outside
Many tenants under one roof, and no door between them left to habit.

So isolation sits one level lower. Every query for events must carry a tenant ID, and the access layer refuses one that does not. A rule cannot forget the filter, because without it the rule gets nothing at all.

The same thinking separates the parts of the system: the part that sees request bodies has no database access, and the part with database access never sees bodies. Compromising one gives no full picture.

See what is happening inside your product

Tell us what you run — a website, an online store, a CRM or a set of client projects — and we will show you what Syoto would look at first.

Stay one step ahead of security risks.

Get security insights and product updates in our newsletter, and connect with our developer community.

Cookie preferences

Choose which cookies we may use. Necessary cookies keep the site working, so they cannot be turned off.