Skip to content
Software Engineering

SaaS Architecture Fundamentals: Multi-Tenancy, Billing and Onboarding

A SaaS product is more than a web app with logins. Tenancy, billing and onboarding decisions shape everything that follows.

ALPIXN Editorial Team 3 min read
Illustration for “SaaS Architecture Fundamentals: Multi-Tenancy, Billing and Onboarding”

Building a software-as-a-service (SaaS) product means serving many customer organisations — tenants — from shared infrastructure, charging them on a recurring basis and letting them sign up and get value without hand-holding. Those requirements shape the architecture from the first sprint. Changing a tenancy model after launch is expensive, so it pays to make deliberate decisions early.

Tenancy models

ModelDescriptionTrade-offs
Shared database, tenant columnAll tenants in the same tables, filtered by tenant IDEfficient; requires rigorous query scoping
Schema per tenantSeparate schemas in one databaseStronger isolation; more migrations to manage
Database per tenantEach tenant has its own databaseStrongest isolation; higher operational cost

Many products start with a shared database and offer dedicated databases for enterprise customers who need them.

Enforcing isolation

With shared tables, every query must filter by tenant. Enforce this centrally — through a data access layer, row-level security in PostgreSQL or middleware — rather than relying on developers to remember. Write automated tests that attempt cross-tenant access.

Identity and access

  • Organisation accounts with users and roles.
  • Invitations and user management by tenant administrators.
  • Single sign-on (SAML or OpenID Connect) for business customers.
  • Audit logs of important actions.

Subscription billing

  1. Plan selectionTiers, seats, usage
  2. CheckoutPayment provider handles card data
  3. EntitlementsFeatures and limits per plan
  4. Usage meteringTrack billable usage
  5. Invoices & dunningRenewals, failed payments
Process diagram: Plan selection, then Checkout, then Entitlements, then Usage metering, then Invoices & dunning.

Use an established billing provider rather than building payment processing. Keep an internal "entitlements" service that answers "can this tenant use this feature?" so plan changes do not require code changes across the app.

Onboarding

The first session determines whether a trial converts. Design onboarding around the first meaningful outcome: importing data, inviting a colleague, completing a first task. Sample data, guided steps and empty states that explain what to do next all help.

Observability and operations

  • Logs, metrics and traces tagged with tenant ID to diagnose customer-specific issues.
  • Rate limits per tenant to prevent one customer affecting others.
  • Backups and tested restore procedures, including restoring a single tenant where possible.

Security fundamentals

Follow web security practices from the start — see web application security essentials. Business customers will ask security questionnaires; documenting your controls early saves time.

Benefits and limitations

A well-architected SaaS product can serve many customers efficiently and evolve continuously. The limitations are upfront complexity and operational responsibility: you run the service for all customers, around the clock.

Implementation considerations

Frequently asked questions

Which tenancy model should we choose?

For most early-stage products, a shared database with strong scoping is efficient. Choose stronger isolation if your customers have strict regulatory or contractual requirements.

Should we support single sign-on from day one?

If you target larger businesses, plan for it early even if you implement it slightly later.

How do we handle customers in different regions?

Data residency requirements may require regional deployments. Design configuration so region-specific infrastructure is possible.

Build your SaaS product with ALPIXN

ALPIXN designs and builds multi-tenant SaaS platforms. See our SaaS development services, our invoicing SaaS concept, or contact us.

This article was drafted by the ALPIXN Editorial Team with AI assistance and edited for accuracy and clarity. It is general guidance, not legal, financial or medical advice.

  • SaaS development
  • Multi-tenancy
  • Architecture
Share
Start a project

Planning something similar?

Share your goals and constraints. ALPIXN will help you scope the work, choose a sensible approach and estimate a first release.