In a multi-tenant app, "don't show tenant A's data to tenant B" isn't a feature you build. It's a promise you can never break, even once.
The danger is that tenancy usually lives as a filter you remember to add — a WHERE clause on every query. Which means it also lives as the one query where a tired engineer forgets it, and that single omission is a data breach, not a bug ticket.
If tenant scoping were enforced server-side by default — part of how data access works, not something each endpoint opts into — then forgetting wouldn't be catastrophic, because there'd be nothing to forget. Isolation becomes a property of the system instead of a discipline you hope everyone maintains.
That's the spine of DineGuru, a multi-tenant restaurant operations platform — a FastAPI modular monolith over PostgreSQL with nine domain modules, where tenancy is scoped on the server rather than trusted to each query. The boring, centralized version is the safe version.
Any guarantee you enforce by convention will eventually be violated by convention. Push it down into the layer where it can't be skipped.
More backend and SaaS work → www.divyakush.com
Top comments (0)