What SaaS Actually Is
SaaS is a delivery and business model before it is a technical one. Two constraints define it. One running codebase serves many unrelated paying customers, and each customer expects their data to be invisible to everyone else. Every consequential decision in a subscription product — the schema, the permission model, the caching strategy, the backup policy — is downstream of those two constraints.
The comparison vendors usually draw is with on-premises software: a licence key, an installer, and a version pinned to a machine the customer owns. SaaS inverts that relationship. The vendor owns the runtime, ships changes continuously, and meters access by time rather than by a seat count purchased once. That inversion is why churn becomes a product metric instead of a support ticket queue.
Products like Salesforce, Slack, and Shopify differ enormously in domain but share one architecture: a multi-tenant control plane, an entitlement system, and a billing pipeline that reconciles itself nightly.
The Five Properties That Separate SaaS From Everything Else
- Shared runtime, isolated data. One deployment serves every tenant. Isolation lives in the data layer, not in per-customer infrastructure.
- Continuous delivery. No installer means no patch window. What you actually ship on each request is markup plus the JavaScript runtime that hydrates it, which is worth understanding properly before it becomes a performance budget — the React documentation on rendering and committing is the clearest explanation we point clients at.
- Metered access. Plans are entitlements — capabilities, quotas, row limits — enforced server-side on every request.
- Usage telemetry by default. Every request already passes through your infrastructure, so per-tenant usage accounting is nearly free if the schema anticipates it.
- Shared operational cost. The hundredth customer costs a fraction of the first, which is why unit economics improve with scale here in a way they never do for bespoke project work.
The common failure is treating SaaS as "a web app with a login", launching flat pricing, and discovering tenancy and entitlements only after the first three customers have incompatible requirements.
Core Components of a SaaS Platform
Five components appear in essentially every subscription product. Each is described below with the code that actually implements it, because on their own these definitions are where scoping conversations quietly go wrong.
Tenant Scoping
The cheapest isolation that still survives a real incident is a required tenant identifier on every row, enforced by the database rather than by developer discipline. In Postgres, row-level security turns "the engineer remembered the where clause" into an invariant the engine maintains:
sqlALTER TABLE documents ENABLE ROW LEVEL SECURITY; ALTER TABLE documents FORCE ROW LEVEL SECURITY; CREATE POLICY tenant_isolation ON documents USING (tenant_id = current_setting('app.tenant_id')::uuid);
The connection sets that setting once per transaction, before any query runs:
typescriptexport async function withTenant<T>( tenantId: string, fn: (tx: Tx) => Promise<T>, ): Promise<T> { return db.transaction(async (tx) => { await tx.execute('SELECT set_config($1, $2, true)', ['app.tenant_id', tenantId]); return fn(tx); }); }
Two failure modes to plan for: a background job or export that runs outside the tenant context and reads across customers, and a support engineer running an unscoped query against production. Row-level security closes the first only if every job wraps its work in withTenant. The second needs statement logging and a documented break-glass procedure.
Authentication and Authorization
Authentication answers who is this. Authorization answers what may they touch. Collapsing the two is the most common cause of a breach in a multi-tenant product, and the OWASP authorization cheat sheet is worth reading in full before the first role ships. The matching guidance on credential handling and session lifetime is in the authentication cheat sheet.
Authentication itself should be deliberately boring: passkey or magic link first, password second, MFA mandatory for anything that touches billing or exports. Sessions stay server-side so they can be revoked, and they rotate on privilege change.
Authorization has to be enforced at the data boundary:
typescriptexport async function requireSession(): Promise<Session> { const session = await auth(); if (!session?.user?.id) redirect('/login'); return session; } export async function requireMembership(orgId: string) { const session = await requireSession(); const membership = await db.membership.findUnique({ where: { orgId_userId: { orgId, userId: session.user.id } }, }); if (!membership) throw new NotFoundError(); return membership; }
Then compare membership.role against a permissions map. Never infer a permission from the interface. Hiding a button is a usability decision; refusing the request is the security decision, and only one of those belongs on the server.
Subscription Billing and Entitlements
Billing is where SaaS products most often ship something technically correct and commercially wrong. The recurring mistake is treating the payment provider as the source of truth. Stripe is authoritative for whether money moved; your database is authoritative for what the customer may do.
The Stripe subscription documentation is explicit that you must handle subscription lifecycle events and the one everyone forgets, invoice.payment_failed. Webhook payloads must be verified against the raw request body, per Stripe's signature documentation, not against a re-serialised object.
typescriptconst ENTITLEMENTS: Record<Plan, Set<Capability>> = { free: new Set(['read_workspace']), pro: new Set(['read_workspace', 'exports', 'api_access']), }; export function can(sub: Subscription, capability: Capability): boolean { if (sub.status !== 'active' && sub.status !== 'trialing') return false; if (new Date(sub.currentPeriodEnd) < new Date()) return false; return ENTITLEMENTS[sub.plan].has(capability); }
Note the explicit expiry check. Webhook delivery is at-least-once and can lag by minutes or hours; an entitlement that reads only status will happily keep serving a customer whose card failed until the dunning retry window closes. Decide the grace period as a business rule and encode it in exactly one place.
The API Surface
Customers integrate before they complain, so the public API is a product surface. Version it from day one, document it, and treat every outbound webhook as a promise: sign it, retry with exponential backoff, and make the receiving end idempotent by keying on your own event identifier. The contract we default to is set out in our guide to structuring a REST API, and it applies equally to the inbound webhooks billing providers send you.
Admin, Jobs, and Observability
Operators need to see revenue, usage, and error rates per tenant without a database login. That means a staff-only surface with its own audit log, plus per-tenant rate limiting and a query budget — an unbounded query from one tenant should degrade that tenant, not the platform.
Data Model: One Schema, Isolated by Key
Most SaaS products start with a shared schema and a tenant key. It is the right default: fewer migrations, one connection pool, and cross-tenant features become possible later. The exceptions — regulatory isolation, wildly different load profiles, or an enterprise deal demanding a dedicated database — are real but should be earned by a specific customer, not designed for in advance.
| Table | Holds | Tenant-scoped |
|---|---|---|
| tenants | One row per paying customer | No |
| users | Global identity, joined by memberships | No |
| memberships | User to tenant, carries the role | No |
| projects, documents, events | The customer's actual content | Yes |
Getting this table wrong on day one is the most expensive mistake available, because retrofitting tenancy into a live product means rewriting every query, every export, and every report.
The Failure Modes We See Most
- The unscoped query. One
SELECTwithout a tenant predicate, usually in a reporting endpoint built in a hurry. Mitigation: row-level security plus a CI check that rejects raw SQL outside the tenant helper. - Entitlements derived from the payment provider at request time. An outbound API call inside the hot path turns a Stripe incident into a total outage. Cache entitlements in your own database.
- No rate limit per tenant. One customer's integration script pulls your database down for everyone. Our write-up on API rate limiting covers the per-tenant shape we default to.
- Shipped dark on performance. A dashboard that renders 4,000 rows because nobody checked until after launch. The Core Web Vitals thresholds published by web.dev are the budget; instrumentation against them belongs in CI, not in a quarterly review.
- Backups that were never restored. A backup you have not restored from is a hypothesis. Test it on a schedule and time it.
What a SaaS Engagement Actually Looks Like
A first production release usually lands between eight and sixteen weeks after kickoff, depending entirely on scope. Weeks one to three are discovery: data model, tenancy strategy, entitlement definition, and the pricing tiers you intend to sell. Weeks four to nine are the core build — auth, billing, the one workflow that justifies the product. Weeks ten onward are hardening: permissions audit, rate limits, backups, and the migration path for existing customers if this replaces something.
The scope mistake to avoid is treating the first release as the product. It is the smallest thing that can charge money safely. Everything else — SSO, audit exports, usage-based tiers, mobile apps — is a backlog item with a price tag, and pricing them separately is what keeps the first release shippable.
How Ullass Builds SaaS Platforms
At Ullass, SaaS work runs through our SaaS development service, which packages the decisions above into a repeatable engagement: tenancy design, entitlement modelling, billing integration, and the operational layer behind them. The PosNova case study shows the same stack applied to a commercial point-of-sale product, and our broader service lineup covers the adjacent work that usually arrives alongside it — commerce, platform infrastructure, and design.
If you are scoping a subscription product and want a second opinion on the tenancy or billing model before you commit to a build, get in touch and we will tell you plainly which parts you can defer.