Building a SaaS Product: From Multi-Tenancy to Subscriptions

Building a SaaS product means creating one application that can serve many customers at once, keep each customer's data separate and charge them on a subscription. Getting there means designing tenant isolation, self-service sign-up, subscriptions and billing, role management, observability and security together from day one.

SaaS (software as a service) is software that customers use in a browser or app without installing anything, in return for a recurring fee. What sets it apart from an ordinary web application is that the same code serves many different customers at the same time. In our web application development work, we account for that difference from the first design session. This article focuses on the product's technical and commercial backbone.

What is multi-tenancy, and which model should you choose?

In a multi-tenant architecture, every customer organization using your product is a tenant: it has its own users, data and settings, but shares the same application. The key decision is how tenants' data is kept apart. There are three basic models:

  • Shared database, shared schema: all tenants live in the same tables, and every row carries a tenant identifier (TenantId). It is the cheapest and simplest model to run; isolation depends entirely on the application's discipline.
  • Schema per tenant: each tenant gets its own schema in the same database. Isolation improves, but schema changes multiply as the number of tenants grows.
  • Database per tenant: the strongest isolation, with per-tenant backup and restore. In return, it carries the highest infrastructure and operational load.

In practice, many products start with the shared model and build a hybrid setup that can move large or specialized customers into their own databases. Whichever model you choose, the tenant filter should never depend on a developer remembering to add it. Mechanisms such as global query filters in EF Core or row-level security in SQL Server enforce it at the data layer.

Decide early how a tenant is identified, too: by subdomain (company.product.com), a claim in the session token or a request header. Cache keys, file storage paths, background jobs and search indexes must carry the tenant ID as well. The gaps that get missed are usually in these side systems, not in the database.

How do you onboard a new customer?

Onboarding is everything between the moment a new customer signs up and the moment they first see the product's value. In SaaS, a sales team cannot walk every customer through setup, so the product has to explain itself. A good onboarding flow usually follows these steps:

  1. Sign-up and verification: a quick start with email verification or a corporate account login.
  2. Workspace setup: basic settings such as the tenant's name, address, language and time zone.
  3. Team invitations: a product gains value as the team uses it, so the invite flow should appear in the first few minutes.
  4. First data: solve the empty-screen problem with an import tool, sample data or ready-made templates.
  5. First success: the first action in which the user experiences the product's core promise, such as a first report, automation or published item.

Measure every step of this flow. How many tenants invite their team or load their first data are among the most reliable early signs of activation, meaning the customer has truly started using the product. Empty states are onboarding opportunities as well: instead of "No records yet," show the user the next step.

How do you build the subscription and billing flow?

The subscription flow covers plan selection, payment, renewal, plan changes, failed payments and cancellation. It is the product's revenue engine, and its bugs turn straight into lost profit. These points deserve the most attention:

  • Code entitlements, not plans: the application should not ask "Is this tenant on the Pro plan?" but "Does this tenant have reporting, and what is its user limit?" Adding a new plan then requires no code change.
  • Use an existing payment platform: work with a payment provider that supports recurring payments, and make sure card data never touches your servers. This also greatly reduces your PCI DSS burden.
  • Process webhooks safely: notifications from the payment provider can arrive late, twice or out of order. The handling logic must be idempotent, meaning that receiving the same event a second time has no extra effect.
  • Define plan changes: does an upgrade apply immediately or at the end of the period, and what happens to data above the limit after a downgrade?
  • Handle failed payments: set up automatic retries and customer notifications, and define a grace period instead of locking the account at once.
  • Remember invoicing rules: in Türkiye, obligations such as e-Fatura and e-Arşiv, and for customers abroad, tax and currency rules, are part of the flow.

Commercial flexibility such as trials, coupons and annual billing always gets requested later. A structure that separates entitlements from plans keeps each of these requests from turning into a development project of its own.

How do you manage roles and permissions inside a tenant?

SaaS products have two separate permission layers. The first is for the customer's own team, with roles such as owner, admin, member or read-only. The second is for your team: platform roles such as support, billing and system administration that operate across tenants.

  • Every tenant should have at least one owner, and ownership transfer should follow a controlled flow.
  • Tenant admins should be able to invite their own users and assign roles without needing your support team.
  • If support staff need to see a tenant's screens, that access should be logged and, where possible, require the customer's consent.
  • Enterprise customers will eventually ask for single sign-on (SSO) with their own identity provider, so build the identity layer with that in mind.

We cover role and permission models in detail in our guide to building an admin panel; the same principles apply to roles inside a tenant.

How do you monitor a SaaS product in production?

Observability is the ability to understand what is happening inside a system through its logs, metrics and traces. In a multi-tenant product it has one more requirement: every signal must say which tenant it belongs to.

  • Tenant-tagged logs: when a customer says "I'm getting an error," you should be able to filter their requests in seconds.
  • Per-tenant usage metrics: this is the only way to see which tenant is consuming a disproportionate share of resources, the so-called noisy neighbor problem.
  • Alerts: set thresholds for error rates, response times and queue backlogs, so the team hears about a problem before customers do.
  • Product metrics: track activation, weekly active tenants, churn and upgrade rates alongside technical health.
  • Status page: announcing outages and maintenance openly reduces both support load and loss of trust.

Shipping often and safely is part of the same discipline; we cover it in DevOps without the drama.

What does a SaaS product need for security?

In SaaS, a single vulnerability can affect every customer, not just one. That is why these controls are not negotiable:

  • Isolation tests: automated tests proving that one tenant cannot reach another tenant's data should run on every release.
  • Encryption: data should be encrypted in transit (HTTPS) and at rest, and secrets kept in a separate vault, not in the code.
  • Per-tenant rate limits: one tenant's heavy use or abuse should not slow down the others.
  • Backup and restore: aim to restore a single tenant's data without touching anyone else's.
  • Data export and deletion: when a subscription ends, customers should be able to export their data, and personal data should be deleted once the purpose of processing has ended, a core principle of both KVKK and GDPR.
  • Tenant-visible audit logs: letting tenant admins see critical changes in their own account is a frequent requirement in enterprise sales.

For a more general list, see our cybersecurity checklist for growing companies.

In SaaS, every customer lives in the same building but behind their own door; build the walls right from day one.

Frequently asked questions

Is a separate database for each customer more secure?

It gives stronger isolation, but it is not a security guarantee on its own, and it adds operational load. For most products, a shared database with a tenant filter enforced at the data layer is a balanced start, with dedicated databases added later for the customers who need them.

Should we build our own payment and subscription system?

No. Use a payment provider that supports recurring payments, and build only what is specific to your product: plans, entitlements and limits. Storing card data yourself is both risky and unnecessary.

Can an application built for a single customer be turned into SaaS?

Yes, but it is a substantial job. The tenant ID has to be added to every table, cache, file path and background job, and isolation then has to be proven with tests. Making this decision early lowers the cost considerably.

What do enterprise customers usually expect from a SaaS product?

Single sign-on, detailed role management, audit logs, data export, clarity on where data is stored and written service commitments are the most common requests. Planning for them in the architecture from the start also shortens the sales cycle.

Where to start?

Before writing code, put three decisions in writing: which model will separate tenant data, which entitlements each plan includes and which roles will exist inside a tenant. Those three decisions shape how easily your product can grow in the years ahead.

If you are planning a SaaS product or thinking about moving an existing application to a multi-tenant architecture, get in touch.

← All articles

Chat on WhatsApp