Myth: Multi-tenancy is a detail.
Reality: Schema-per-tenant and row-level security have very different migration, backup, and performance trade-offs. The wrong choice compounds for years.
From MVP to scale, with architecture decisions made for longevity, not just demo day. Multi-tenancy, billing edge cases, and real traffic: we know what breaks and how to prevent it.
Boring infrastructure, careful tenancy, billing edge cases handled before launch.
class TenantMiddleware:
"""Resolve the tenant from subdomain or header and scope the DB session."""
async def __call__(self, request, call_next):
tenant = resolve_tenant(
request.headers.get("X-Tenant-ID")
or extract_subdomain(request.url.hostname)
)
if not tenant or not tenant.is_active:
raise HTTPException(404)
request.state.tenant = tenant
with schema_context(tenant.schema_name):
return await call_next(request)Myth: Multi-tenancy is a detail.
Reality: Schema-per-tenant and row-level security have very different migration, backup, and performance trade-offs. The wrong choice compounds for years.
Myth: Stripe handles billing.
Reality: Stripe handles payments. Mid-cycle plan changes, proration, failed retries, and tax still need explicit design.
Myth: We'll scale later.
Reality: You will, but cheap early choices like idempotent jobs and good indexes make 'later' far less painful.
Myth: The MVP needs this one more feature.
Reality: The MVP needs evidence. We push back on scope that users haven't asked for.
Step 01
Users, jobs to be done, pricing model, and risks.
Step 02
Tenancy, auth, billing, and data model decisions written down.
Step 03
Core workflow, billing, and admin in short iterations.
Step 04
Monitoring, backups, support process, and a feedback loop.
Step 05
Performance work guided by real usage data.
A SaaS product is not just a web app with a login page. It serves many customers from one system, so every request must know which tenant it belongs to, every query must stay inside that tenant's data, and one customer's heavy usage must not slow down everyone else.
It also lives or dies by the unglamorous parts: subscriptions that renew, upgrade, downgrade, and fail; invoices and taxes; trials that convert; onboarding that works without a call; and an admin area where your own team can support customers. These are where many early products stall.
We design for the product you will have in a few years, without over-building for it today. That means a clean tenancy model, a sensible monolith before microservices, and the operational basics, including backups, monitoring, and audit logs, from the first release.
The parts every SaaS needs, whatever it sells.
| Area | What we build |
|---|---|
| Tenancy | Tenant-aware data model, row-level security or schema-per-tenant |
| Identity | Sign-up, SSO, invitations, roles, and permissions |
| Billing | Plans, trials, upgrades, proration, invoices, and dunning via Stripe or similar |
| Admin | Internal tools for support, impersonation with audit, and feature flags |
| Platform | Background jobs, email, file storage, rate limits, and webhooks |
| Operations | Monitoring, backups, audit logs, and incident runbooks |
One deployable app with clear internal boundaries, split later only where scale demands it.
Strong consistency, row-level security, and room to grow before anything more exotic is needed.
Tenant isolation tested automatically, secrets managed properly, and least-privilege access.
Track what customers use, so pricing can follow value.
Step 01
Users, core workflows, pricing model, and the smallest product worth charging for.
Step 02
Tenancy, identity, billing, and the deployment pipeline.
Step 03
The workflows that deliver the main value, built in short iterations.
Step 04
Real customers on the product, with feedback and monitoring.
Step 05
Public launch, then a steady cadence of improvements.
The first pitfall is building every feature before the first customer pays. We help cut the first release down to what proves the product, then grow it with real usage data.
The second is weak tenant isolation. A single missing filter can expose one customer's data to another, so isolation is enforced at the database level and covered by automated tests.
The third is treating billing as a weekend task. Proration, failed payments, tax, and refunds have many edge cases, and getting them wrong costs revenue and trust.
| Measure | Why it matters |
|---|---|
| Activation rate | How many sign-ups reach the moment of value |
| Response times | How fast the product feels under real load |
| Error rate | Failures users actually hit |
| Deployment frequency | How quickly improvements reach customers |
Imagine a founder with a working spreadsheet-and-email process for managing field inspections, sold as a service to a few clients. The first release turns it into a multi-tenant app: each client gets its own space, inspectors use a mobile-friendly form, and managers see reports.
Stripe handles subscriptions from day one, an admin area lets the founder support clients, and the same codebase onboards the next ten customers without manual setup.
Success is a product customers can sign up for, pay for, and use without a call, running reliably while the team ships improvements every week.
Application code that filters by tenant on every query works until one query forgets. PostgreSQL's row security policies restrict, per user, which rows normal queries can return or modify, adding a second line of defence beneath the applicationSource [1]. The documentation also warns that superusers, roles with BYPASSRLS, and normally table owners bypass these policiesSource [1], so we design roles so the application never connects with that power.
SaaS also needs a delivery rhythm customers can trust. DORA tracks change lead time, deployment frequency, failed deployment recovery time, change fail rate, and deployment rework rateSource [2]. We set these up from the first release, so quality is measured rather than assumed.
Build vs buy
When to build custom software, when to buy SaaS, and when to extend an ERP. A practical decision framework with the costs people forget.
DevOpsCloud architecture
Cloud architecture on AWS, GCP, Azure, and bare metal: landing zones, networking, Terraform, cost control, and hybrid setups.
WebQA & test automation
Automated testing for web, mobile, APIs, and Odoo: unit, integration, end-to-end, and visual tests running on every pull request.
Next step
Thirty minutes with an engineer, no slide deck required. You'll leave with a clearer picture, whether or not we work together.