Skip to content

New guideModernizing a legacy system without stopping the business

Architecture

How to build a scalable SaaS platform: the decisions that matter early

Tenancy, data, billing and operations — what to get right in version one.

Author
Eryon Engineering
Published
Updated
Reading time
2 min
Subscription SaaS dashboard showing members, revenue and activity

Key takeaways

  • Scalability starts with the data model and tenancy, not with servers.
  • Keep the application tier stateless so it can scale horizontally.
  • Move slow work to background queues from the first release.
  • Treat billing, onboarding and observability as core features.

Most SaaS scaling problems are decided in the first release. A practical guide to the architecture choices that let a SaaS product grow without a rewrite.

What “scalable” actually means for SaaS

Scalability is often reduced to handling more traffic. For a SaaS business it means more: onboarding more customers without more manual work, adding features without slowing every release, and keeping one large customer from degrading the experience for everyone else.

The expensive part is that many of these properties are decided in the first release, when the team is small and speed matters most. The goal is not to build for millions of users on day one, but to avoid decisions that force a rewrite later.

Get tenancy and the data model right

Every table that holds customer data needs a clear owner — usually a tenant or organisation identifier — and every query needs to respect it. Enforcing that in the database, for example with PostgreSQL row-level security, protects you from the one query that forgets the filter.

Design the data model around your domain, not around screens. Screens change every month; entities such as accounts, subscriptions, orders and invoices change rarely and carry your reporting.

  • Put a tenant identifier on every customer-owned record.
  • Enforce tenant isolation in the data layer as well as the application.
  • Index for the queries you run most, and review slow queries regularly.
  • Plan archiving for data that grows without limit, such as logs and events.

Stateless services and background work

Keep web servers stateless: sessions in a shared store, files in object storage, no local state that ties a user to one machine. Then scaling the application tier is a matter of adding instances behind a load balancer.

Anything that doesn't need to finish before the user gets a response — emails, exports, PDF generation, webhooks, reports — belongs in a background queue. Queues smooth traffic spikes and stop slow work from blocking requests.

Billing, plans and onboarding are architecture

Subscription billing touches everything: which features a customer can use, what happens when a payment fails, how upgrades are prorated. Model plans as entitlements — limits and features the application checks — rather than hard-coding plan names.

Self-service onboarding is what lets a SaaS business grow without growing the support team. Measure how long new accounts take to reach their first meaningful result, and design the first-run experience around shortening it.

Build in the ability to operate it

A product you can't observe is a product you can't scale. From the first release, include the basics that make incidents short and releases safe.

  • Structured logs with tenant and request identifiers.
  • Error tracking and uptime monitoring with alerts.
  • Automated backups with a tested restore procedure.
  • A deployment pipeline with staging and quick rollback.
  • An internal admin console for support and account management.
Related serviceSaaS Product DevelopmentMulti-tenant products with billing, onboarding and room to grow.

Enjoyed this? Get the next one by email.

One email a month. Unsubscribe any time.

Have a productworth building?

Let's turn the idea into a system your business can actually use.