Designing Billing for SaaS: Usage-Based Pricing Without the Engineering Nightmare
Usage-based pricing sells well on a pricing page. The metering, reconciliation and dispute-handling behind it is where most implementations quietly fail.
The shared-schema-with-a-tenant-id approach that got you to your first hundred customers is not the same decision as your thousandth. Here is how we decide.
Almost every SaaS platform starts with a shared database and a `tenant_id` column on every table, and for good reason — it is the fastest path to a working product and the easiest to operate with a small team. The mistake is treating that as a permanent architectural decision instead of the correct decision for a specific stage of the business.
There is no universally correct answer here — there is a correct answer for your compliance requirements, your customer size profile, and your team's operational capacity. A platform selling to five enterprise healthcare customers has a very different answer than one selling to five thousand small businesses.
The trigger is rarely "we have grown." It is usually a specific enterprise requirement: a customer's security review demands physical data isolation, or a compliance framework requires the ability to fully delete one tenant's data on a defined timeline in a way your shared schema cannot cleanly guarantee. That single deal-blocking requirement is worth acting on immediately — general unease about scale is not.
Whichever model you choose, tenant isolation belongs in a single, heavily tested layer — a query builder, an ORM middleware, a database policy — never in the discipline of every engineer remembering to add a `WHERE tenant_id = ?` clause by hand. We have inherited more than one codebase where a single missed clause in a rarely-touched report endpoint leaked one customer's data into another's export. That bug class should be architecturally impossible, not merely discouraged in a code review comment.
More from the same category.
Usage-based pricing sells well on a pricing page. The metering, reconciliation and dispute-handling behind it is where most implementations quietly fail.
A hardcoded "admin" and "member" role gets you to your first enterprise deal. It does not survive contact with their security questionnaire.
"We will fix it later" is a real financial decision with a real interest rate. Here is how we actually quantify it for clients.
Thirty minutes with the people who would actually do the work — no discovery deck, no account manager.