BeakrGo to website
Docs/Security/Multi-tenancy & isolation

Multi-tenancy & isolation

Beakr is a multi-tenant platform where every customer's data is isolated at the database layer — not in application code. Even in a shared infrastructure model, no tenant can access another tenant's data.

How multi-tenancy works

All Beakr customers share the same application infrastructure — compute, networking, and database — but every query is scoped to the authenticated tenant by PostgreSQL itself. This is enforced through Row Level Security (RLS), a database-native isolation mechanism that cannot be bypassed by application code.

This approach provides isolation guarantees that exceed what most single-tenant deployments offer, where a single database superuser typically has unrestricted access to all data.

Database-enforced Row Level Security

Tenant isolation is not a filter in a WHERE clause — it is enforced by PostgreSQL at the database engine level:

Fail-closed design

If tenant context is missing from a request, the database returns an error — it does not fall back to unfiltered data. This means a misconfigured request fails safely rather than exposing data.

Role separation

Database rolePurposeCan bypass RLS?
beakr_appAll application queriesNo
beakr_migratorSchema migrations onlyCannot read tenant data
beakr_adminInfrastructure operations onlyRestricted to infra tasks

Organization model

Each customer operates within their own organization. Organizations are the primary isolation boundary:

What is shared, what is not

LayerShared?Isolation mechanism
Application codeSharedSame codebase for all tenants
Compute (ECS)SharedRequests authenticated and scoped per-tenant
Database (RDS)Shared instanceRow Level Security — PostgreSQL enforces tenant boundaries
File storage (S3)Shared bucketObject keys scoped to organization ID
Cache (Redis)SharedCache keys namespaced to organization
Network (VPC)SharedAll traffic encrypted, no tenant-to-tenant communication
Encryption keysShared (AWS-managed)AES-256 at rest for all data stores

When to choose single-tenant

For most customers, our multi-tenant architecture with database-enforced RLS provides stronger isolation than a typical single-tenant deployment. However, some organizations require dedicated infrastructure for regulatory or contractual reasons: