A founder shows an investor a demo: a shift-planning application for retail chains, a happy pilot customer, three more prospects waiting. The CTO estimates that selling to the next customers needs “a few tweaks”. In practice the application has a single database with no notion of a customer, a shared admin login, invoices typed up by hand and prices hard-coded in the source. Every new customer means a copy of the entire environment.
Six months later the company has seven customers and seven copies of the application. Every bug fix needs seven deployments, two copies have drifted to a different version, and a new plan with a seat limit cannot be introduced without code changes. The team that was supposed to build features spends its time on operations. Nobody made a bad decision on purpose. Nobody made the decision at all.
This article is for CTOs and founders who are building a SaaS product, or turning an application built for one customer into SaaS, and for anyone evaluating SaaS development services or a SaaS development company. The thesis is this, and not every architect will agree: the cost of a SaaS product is set not by its features but by three decisions made in the first weeks. The first is how a customer (a tenant) exists in your code. The second is where you enforce isolation of its data. The third is whether billing is an entitlement model or just an integration with a payment gateway. By default, the cheapest option over the whole lifecycle is a shared model with isolation enforced in the database and the ability to move a single customer into a dedicated environment. A database per customer from day one, and “we’ll add multi-tenancy later”, are the two most expensive mistakes, and both only become visible after a year.
Why do decisions from the first weeks, not the feature list, set the cost of SaaS?
In a classic custom software project, cost grows roughly in line with scope: more screens, more integrations, more hours. A SaaS product adds a second dimension that grows with the number of customers rather than features. It is the cost of serving each additional tenant: provisioning, migrating its data with every schema change, monitoring, backups, support, billing, and satisfying its security team’s questionnaire. If the architecture makes that cost fixed per customer, the product scales like an implementation business, not like software.
Microsoft’s Azure Architecture Center guide to tenancy models puts it plainly: when each customer gets dedicated resources and one tenant requires a certain infrastructure cost, a hundred tenants probably require a hundred times that cost. The same guide notes that choosing a tenancy model is not only a technical decision but also a commercial one, because it depends on whether the business wants to minimise cost per tenant or maximise each tenant’s experience and isolation.
The second reason is the cost of change. Decisions about the data model reach into every query, every file, every queue and every report. Changing a screen takes days. Changing how data is assigned to a customer takes months, because it has to happen everywhere at once and be tested on data that already belongs to paying customers. This is the same mechanism we describe in our piece on the total cost of ownership of software: what a system costs over five years is decided in the first months and paid for in the years after.
That is why a SaaS budget deserves a separate line for the multi-tenancy foundation: the tenant model, isolation, entitlements and billing. It is usually a few weeks of work at the start. Leaving the line out does not mean the work will not be done. It means it will be done later, at higher cost, under pressure from customers who are already paying.
What exactly is a tenant, and why is it the first data model decision?
A tenant is the unit whose data and configuration the system keeps apart from everyone else’s. In B2B SaaS it is usually the customer’s company, but that simple answer quickly stops being enough. Microsoft’s guide points out that a customer may have divisions in several countries with different requirements, and sometimes wants two instances of your service to keep development and production apart. One customer can therefore map to several tenants.
A tenant is not the same thing as a user, nor the same as a billing account. A user may belong to several tenants, for example a consultant serving several clients or an accountant at an outsourcing firm. A billing account may cover several tenants when a group pays one invoice for its subsidiaries. If those three concepts are glued into one in the data model, each of those scenarios will require a rebuild.
Practical advice: before the first business table is created, write down on one page the answers to five questions. Who is the tenant? Can a user belong to more than one tenant? Can one billing account pay for several tenants? Can a tenant have a hierarchy, such as headquarters and branches? Will data ever be shared across tenants, for example in a marketplace or in benchmark reports? Every “yes” is a table or relationship that is easy to add at the start and hard to insert into a running system.
Second, the tenant identifier should exist in every table that stores customer data, including child tables where it could formally be derived through a foreign key. It looks like redundancy, but it makes three things easier: enforcing isolation at the database level, exporting one customer’s data, and moving that customer to a separate database. You will need all three sooner than you think.
Silo, pool or bridge: which isolation model should you start with?
In its 2020 whitepaper “SaaS Tenant Isolation Strategies”, AWS named three basic models that have since become the industry’s shared vocabulary. The silo model gives each tenant its own resources, from the database to the entire application stack. The pool model has tenants share infrastructure, with logical separation. The bridge model combines the two: some layers are shared and some dedicated, or most customers run in the pool while selected ones get a silo.
Microsoft describes the same options in different words. Automated single-tenant deployments are the silo. A fully multitenant deployment is the pool. Vertical partitioning means most customers share a deployment while those who need higher performance or isolation get their own. Horizontal partitioning means, for example, a shared application tier with separate databases. Both guides agree on the trade-off: the silo gives the strongest isolation and no noisy neighbour problem, but costs the most and demands automated operations; the pool is the cheapest, but requires discipline in data isolation and load management.
That trade-off does not make the choice symmetrical. My position is that for most new B2B products the starting point should be the pool, with two properties that let you move to a bridge later. The first is isolation enforced in the database, not only in application code. The second is a tenant-to-deployment mapping layer: a table that records which database or environment holds each customer’s data. At first every row points to the same place. When a customer arrives who will pay for a dedicated database, you move it without changing application code. Microsoft calls such deployments stamps, and the mapping layer is what lets you move tenants between them at your discretion.
When does a silo make sense from the start? When you will have a handful of customers, each paying an annual contract in six figures, and their regulatory or contractual requirements rule out a shared database. Think of systems for banks, hospitals or law firms where the customer explicitly demands dedicated infrastructure. In that case, though, you are really building automated multi-customer deployments of installed software, not classic SaaS, and you should price it accordingly.
Why is a database per customer usually a mistake at the start?
A database per customer is tempting because it looks simple. Application code does not need to know about tenants; it just picks the right connection. A leak between customers seems impossible. A customer asks about isolation and you answer that it has its own database. The problem is that this simplicity has been moved from code into operations, and operations grow with the number of customers.
Every schema change has to run as many times as you have customers. With three hundred databases, a migration that takes a minute on one becomes a deployment process with queueing, retries and reporting. If a migration fails halfway through the fleet, some customers run the new schema and some the old, and application code has to handle both. Every database needs monitoring, backups, restore tests and engine upgrades. A cross-customer report, such as active users across all accounts, requires querying every database or building a separate warehouse.
Then there is infrastructure. Even the smallest managed database instance at a cloud provider is a fixed monthly charge, whether or not the customer uses it. With hundreds of customers on an entry-level plan, you pay for hundreds of mostly idle instances. The alternative of many databases or schemas on one server lowers the bill, but at thousands of schemas you run into migration times, connection counts and system catalogue size. The exact threshold depends on the engine, schema size and how you deploy changes, so measure it on your own schema before building a business model on top of it.
There is also a less visible cost: no shared reference data, and difficulty building features that by nature span customers, such as benchmarks, recommendations or a marketplace. Each such feature needs a separate aggregation layer. None of this means a database per customer is always wrong. It means it is a decision about the company’s operating model, not just a schema choice, and it should not be made by default because “it was fastest for the pilot”.
How do you enforce data isolation so that one bad query does not become a breach?
AWS’s SaaS architecture fundamentals whitepaper states a principle worth pinning above the team’s desks: the fact that a tenant user is authenticated does not mean the system has achieved isolation. A user can be authenticated and authorised and still access another tenant’s resources, because nothing in authentication itself blocks it. Isolation is a separate mechanism that uses tenant context to restrict access to every resource.
In the pool model the most common approach is to append a tenant filter to every query in application code. It works as long as every developer remembers it, in every query, every report, every repair script run on a Friday evening. One omission is enough for a customer to see another customer’s data. So it is worth pushing enforcement down to a layer where it cannot be skipped by accident.
In PostgreSQL that layer is row-level security, or RLS (our guide to PostgreSQL covers the engine more broadly). The application sets the current tenant at the start of a transaction, and the database adds the condition to every query itself. The PostgreSQL documentation describes three traps that regularly catch teams out. First, superusers and roles with the BYPASSRLS attribute always bypass policies. Second, the table owner normally bypasses them too, unless you switch on FORCE ROW LEVEL SECURITY for the table. If the application connects as the schema owner, which is common when migrations and the application share one account, the policies formally exist but do nothing. Third, when RLS is enabled on a table with no policy, a default-deny applies and no rows are visible: safe behaviour, but confusing on the first deployment.
A fourth trap comes not from the PostgreSQL docs but from connection architecture. If you use a connection pooler in transaction mode, a tenant identifier set at session level can leak into the next request that receives the same connection. Tenant context has to be set within the transaction, so that it expires with it.
Isolation does not end at the database. The same tenant context must cover cache keys, object storage paths, queue messages, search indexes, logs and exports. A good practice is an automated test suite that logs in as tenant A and tries to read tenant B’s resources through every public API endpoint. Microsoft explicitly recommends testing your isolation model to verify that one tenant’s data is not leaked to another. Such tests cost a few days at the start and protect against an incident that costs customers. How serious isolation flaws in multi-tenant services can be was shown by ChaosDB: in August 2021, Wiz researchers described a flaw in Azure Cosmos DB that let them obtain access keys to databases of thousands of Microsoft customers. Microsoft responded quickly, and customers had to rotate their keys. If this happens to a cloud provider, it will happen in your product if isolation depends on developers’ memory.
What does “we’ll add multi-tenancy later” actually cost?
It is the most common decision at startups and an understandable one. The pilot customer needs a working product in three months, not a foundation for the next five years. The trouble is that the cost of adding tenant context grows with every table, every query and every place where data leaves the database.
Let us estimate it. This is an estimate, not market data, and it depends on the factors listed below. A typical B2B application after a year of development has a few dozen tables of customer data, several hundred queries, a few queues, object storage, a search index and a handful of reports. Adding a tenant identifier means schema changes, migrating existing data, reviewing every query, changing cache keys and file paths, reworking permissions, rebuilding the admin panel and full regression testing. With two senior engineers that is around three months of work, or about 120 person-days. At senior nearshore rates of EUR 335–485 per day, that is roughly EUR 40,000–58,000, before counting the cost of freezing feature development for that period.
Factors that raise this cost: the number of places where code bypasses the data access layer (raw SQL in reports, scripts, batch jobs); the number of integrations that assume a single customer; data that is already shared across customers without an explicit model; and missing automated tests to prove nothing broke. Factors that lower it: a single data access layer, consistent naming and good test coverage.
By comparison, introducing a tenant identifier, RLS policies, a tenant-to-deployment mapping table and isolation tests at the very start is typically a few days to two weeks of one person’s work. The difference is roughly tenfold. Not because the later work is technically harder, but because it has to be done on a live system, with customer data, without downtime.
If you inherit an application built for one customer that must now become a product, start by measuring. How many places in the code read data while bypassing the shared layer? Which tables have no natural owner? You can commission this as an independent technical due diligence review; at ARDURA the Code Health Audit starts from EUR 4,500, takes one to two weeks and has a fixed scope. That is less than one month of a rebuild started without a map.
How do you contain noisy neighbours and attribute infrastructure cost to each customer?
In the pool model, one customer running a heavy report or importing a million records can slow the system for everyone else. Microsoft describes this as the noisy neighbour antipattern and notes that in a fully multitenant deployment the cost of scaling a single deployment can grow non-linearly once a shared database runs out of throughput.
Three mechanisms are worth designing from the start, because each depends on tenant context. The first is per-tenant limits: requests per second, concurrent batch jobs, import size. The second is fair-share queues, where one customer’s jobs cannot block the whole worker pool. The third is the ability to move a tenant to a separate resource pool when its load profile no longer fits the rest. That last one depends on the tenant-to-deployment mapping table described above.
The other side of the same problem is cost. If you do not know what it costs to serve a given customer, you do not know whether a plan is profitable. In a silo, attribution is easy because resources are dedicated. In a pool you have to measure consumption: queries, CPU time, storage, egress, calls to paid third-party APIs such as language models. These measurements are often called metering, and the result is unit cost per tenant.
This is where architecture meets FinOps practice. A metric such as “cloud cost per tenant per month” shows when the entry plan is subsidised by the premium plan, or when one customer consumes a third of the infrastructure budget. Without a tenant tag in logs and metrics, that analysis takes manual work and usually never happens. Tagging every telemetry event with the tenant costs little at the start and turns the pricing conversation from intuition into arithmetic.
What should you buy and what should you build in billing?
Here the position is easiest to state, even though many teams do the opposite: buy payments, dunning and tax, build entitlements. Plenty of teams write their own subscription logic, billing periods, proration on plan changes and failed payment retries, while keeping what a customer may do scattered through the code as conditions like “if plan is premium”. That is the most expensive combination possible.
Why buy payments and subscriptions? Because the area is full of exceptions: cards expire, issuers decline payments without saying why, customers change plans mid-cycle, and strong customer authentication rules in Europe add extra steps. Stripe Billing on its pay-as-you-go plan costs 0.7% of billing volume, on top of standard payment processing fees (the rate went up from 0.5% in 2024). With EUR 1 million a year flowing through the system, that is about EUR 7,000 a year for the subscription layer. An in-house implementation of comparable reliability would cost many times more in maintenance alone.
The alternative is a merchant of record, where a provider such as Paddle formally sells your product to the end customer and takes over sales tax and VAT across jurisdictions. It costs more, typically around 5% plus 50 cents per transaction, or roughly EUR 50,000 a year plus per-transaction fees on the same EUR 1 million, but it removes the obligation to register and file in many countries. For a small team selling to individuals worldwide, that is often a sensible choice. For B2B SaaS selling mainly to companies, with contracts and invoices, your own payment processor account and your own invoicing process usually work better.
What should you build? The entitlement model. It is the layer that answers what a given tenant can do right now: how many seats it has, which modules are enabled, what its usage limit is, whether it is in a trial. Application code asks about an entitlement (“may this tenant add another user?”), not about a plan (“is this tenant on premium?”). A pricing change, a new plan or a bespoke contract with a large customer then becomes a configuration change, not a deployment. The mechanism resembles feature flags, except that its source is the customer contract rather than a team decision.
The second thing to build is a usage event ledger, if pricing depends on consumption: documents, API calls, gigabytes processed. Events should be stored durably, with the tenant identifier and a timestamp, so every invoice can be reproduced and explained to the customer. A dispute over an invoice that cannot be rebuilt from source data usually ends in a discount, not an explanation.
How do tax and e-invoicing rules change billing architecture?
In the EU, B2C sales of electronically supplied services have followed a single EU-wide threshold of EUR 10,000 in annual cross-border sales since 1 July 2021. Above it, VAT is charged at the customer’s country rate and declared through the One Stop Shop (OSS). Your customer data model therefore has to store country and status (a business with a VAT number or a consumer), and the system must be able to evidence where the customer is located.
B2B invoicing in Europe is moving from PDFs to structured e-invoices, country by country. Belgium made domestic B2B e-invoicing mandatory from 1 January 2026, with Peppol as the expected network. Poland’s national e-invoicing system, KSeF, became mandatory for receiving invoices for all businesses from 1 February 2026, for issuing by the largest taxpayers from the same date and for most others from 1 April 2026. The EU’s VAT in the Digital Age package, published in March 2025, sets mandatory e-invoicing for cross-border B2B transactions from 2030. For a SaaS vendor this means an invoice is no longer a file your payment gateway generates. It is a structured document submitted to a national system or network, sometimes with an identifier returned before it counts as issued.
In the US, the picture is different but just as architectural. In South Dakota v. Wayfair (June 2018), the Supreme Court overruled the physical presence rule, allowing states to require out-of-state sellers to collect sales tax. Most states have since set economic nexus thresholds, and whether SaaS is taxable at all varies by state. A billing system that records the customer’s location and tax status for each invoice, and delegates calculation to a tax engine or merchant of record, avoids rebuilding billing when the first US customers sign.
The architectural conclusion is simple: billing has three independent layers that change for different reasons. Entitlements change when the product and pricing change. Payments change when you switch processor. Invoicing and tax change when regulations change. Separate them, and each change touches one layer. Glue them into one call to the payment gateway, and every outage of a national e-invoicing system, or every change to its interface, stops your billing.
Which enterprise requirements must the architecture anticipate?
The first large customer usually arrives with a security questionnaire running to dozens or hundreds of questions, and US buyers often ask for a SOC 2 report as well. Some of the questions concern process, but many concern architecture directly, and “it’s on our roadmap” often ends the conversation. Five areas are worth anticipating even if you do not build them immediately.
Single sign-on through SAML or OpenID Connect, plus automated provisioning through SCIM. In the data model this means a tenant can have its own identity provider, and a user can be created and removed from outside. If a user account is hard-wired to a password in your database, adding SSO later means rebuilding login.
An audit trail: a record of who changed what in a tenant’s data, and when. Enterprise customers want to browse and export it. If audit events are captured from the start with a tenant identifier, it is a matter of building a screen. If not, history from before the feature shipped cannot be reconstructed.
Data residency. Some customers require data to stay in the EU, or in a specific country. A tenant-to-deployment mapping table lets you launch a second deployment in another region and assign selected customers to it, instead of building a separate product.
Exporting and deleting one tenant’s data. Under the GDPR, a SaaS provider acting as processor must work under a data processing agreement (Article 28), and controllers must report personal data breaches within 72 hours where feasible (Article 33), which means you must be able to tell a customer quickly whose data an incident touched. The EU Data Act, whose provider-switching rules for data processing services have applied since 12 September 2025, covers SaaS too: a customer may initiate switching with a notice period of no more than two months, and the switch itself should complete within a maximum of 30 days. From 12 January 2027 providers may no longer charge switching fees. If a customer’s data is spread across the database, files and indexes without a consistent tenant identifier, every such export is a manual project.
A per-customer service level agreement. When one customer pays for higher availability, you need either a dedicated deployment or the ability to measure availability for that customer alone. Both require tenant context in monitoring.
What do these decisions cost, and how do they compare side by side?
The table below brings together the decisions that set the cost of a SaaS product. The “cost of changing later” column is an estimate based on the factors in earlier sections, not market data. It is meant to show order of magnitude and direction, not a figure for your project.
| Decision | Cheapest option at the start | Cost of changing later (estimate) | Recommended default |
|---|---|---|---|
| Tenant model | No tenant concept, one customer per instance | High: review of every query, file and queue; months of work | Tenant identifier in every table from the first migration |
| Isolation model | Database per customer (“safer”) | Medium to high: consolidating databases, migrating data | Pool with a tenant-to-deployment mapping table |
| Isolation enforcement | Filter in application code | Low technically, high after an incident | RLS in the database, FORCE, separate application role, cross-tenant tests |
| Noisy neighbours | No limits | Medium: limits, queues, moving tenants | Per-tenant limits and queues, ability to move a tenant to its own pool |
| Cost per customer | Not measured | Medium: retrofitting tags into telemetry | Tenant identifier on every event and metric |
| Subscriptions and payments | Built in-house | High: maintenance, edge cases, compliance | Payment processor or merchant of record |
| Entitlements | ”If plan = premium” checks in code | Medium: refactoring every check | Own entitlement model and usage ledger |
| Invoicing and tax | Invoice from the payment gateway | Medium: separating rating, e-invoicing, OSS, US sales tax | Separate invoicing layer with tax engine and e-invoicing integrations |
| Enterprise requirements | None (SSO, audit, export) | High for audit and export, medium for SSO | Audit events from day one; SSO and SCIM when the first large customer appears |
How does this translate into a budget? The multi-tenancy foundation, meaning the tenant model, RLS, deployment mapping, isolation tests, telemetry tags and a basic entitlement model, is an estimated three to five weeks of work for one senior engineer or architect on a new project. At EUR 335–485 per day for a senior developer, that is roughly EUR 5,000–12,000. Integrating a payment processor, a tax engine and the e-invoicing networks your customers require adds further weeks, depending on how complex your pricing is. That is a small share of a first version budget, which for a SaaS product usually runs into six figures in euros.
More important than the amount is that those weeks produce no visible features. Neither the investor nor the first customer will see them. That is why teams under deadline pressure skip them, and the bill arrives in year two, when the product has customers and the team rebuilds foundations instead of shipping features.
Are microservices, Kubernetes and multiple regions also cost decisions at the start?
Yes, but they work in the opposite direction to the decisions above. The tenant model and isolation are cheap at the start and expensive later. Microservices, container orchestration on Kubernetes and multi-region deployment are expensive at the start, and their benefits appear only at a scale most products do not reach in their first two years.
For a new SaaS product the sensible starting point is usually a modular monolith: one application, one database, clear module boundaries in code and tenant context flowing through every layer. We discuss the trade-off at length in our article on monoliths, microservices and the options in between. From a multi-tenancy point of view the monolith has one specific advantage: tenant context has to cross one process boundary, not dozens of network calls between services. In a microservices architecture every service must read and enforce the tenant identifier on its own, and every omission is a potential leak.
The same goes for regions. If your first customers are in Europe, one deployment in a European cloud region is enough, and it keeps GDPR conversations simple. The tenant-to-deployment mapping table means a US region can be added later without rebuilding the application, when a US customer’s contract requires it. That is a decision that costs little today and keeps an option open: you do not build multiple regions, you just avoid closing the door to them.
The general rule: invest early in the things that reach into data and are hard to change, and defer the things that concern infrastructure and can be changed without touching customer data.
How should you plan the first 90 days so you do not close off your options?
The first two weeks are decisions, not code. Write down the tenant model (answers to the five questions from the section on tenants), choose the isolation model, decide which data may be shared across tenants, and describe what a billing account looks like. If you are building with an external SaaS development partner, these decisions should come out of the discovery phase and go into the contract as architectural assumptions; our article on choosing an MVP development partner covers what else belongs there.
Weeks three to six are the foundation: the first migration with a tenant identifier in every table, RLS policies with FORCE and a separate database role for the application, tenant context set within each transaction, the tenant-to-deployment mapping table, cross-tenant isolation tests in the CI pipeline, a tenant tag in logs and metrics, and the skeleton of an entitlement model. The team can build the first features in parallel, because the foundation does not block interface work.
Weeks seven to twelve are billing and sales readiness: payment processor integration, rating based on entitlements and usage, invoicing with tax calculation and the e-invoicing channels your target markets require, self-service provisioning of a new tenant without a developer, and export of one tenant’s data. By the end of this period you should also have a simple answer to the question of what an average tenant costs you per month.
At the end of 90 days, check five criteria. Can a new customer be set up without code changes or a new deployment? Does a test logged in as tenant A see none of tenant B’s data through any API endpoint? Is changing a plan’s price a configuration change? Can you export all of one tenant’s data with a single command? Do you know what your most expensive tenant costs you each month? Every “no” is a backlog item with higher priority than the next feature, because its cost grows with every new customer. An unmet criterion is technical debt whose interest is counted in customers rather than time.
What are the key takeaways for CTOs and founders?
The cost of a SaaS product rarely depends on the number of screens. It is set by decisions about how a customer exists in the data, where you enforce its isolation and how you bill for what it uses. Those decisions are made in the first weeks, often without anyone noticing, and their cost arrives in year two.
Remember six things. First, define tenant, user and billing account as three separate concepts before the first table exists. Second, start with the pool model, a tenant identifier in every table and a tenant-to-deployment mapping table, so you can later move selected customers into a silo. Third, enforce isolation in the database, not only in code, mind the table owner and connection pooler traps, and test isolation automatically. Fourth, measure usage and cost per tenant from day one, because without it you do not know whether your pricing is profitable. Fifth, buy payments, subscriptions and tax, but build your own entitlement model and usage ledger. Sixth, keep invoicing separate from payments, because e-invoicing mandates, VAT and US sales tax rules change independently of your payment processor.
If you are building a SaaS product, or turning an application built for one customer into SaaS, see how we work in custom software development, or book a call. We start by reviewing the data model and architecture decisions before any code is written whose change would cost months.