Draft · · 4 min read
SaaS MVP architecture: what to build before you try to scale
A concrete SaaS architecture guide for founders and full-stack developers covering product slices, tenant boundaries, async work, and scaling triggers.
By Sireesh D · Full stack development & product operations
AI-assisted editorial draft for review. Examples are illustrative, not client results. This page is excluded from search indexing until the draft is approved.
An MVP should be small enough to change and complete enough to reveal whether a customer can get value from it. A thin interface over an unreliable workflow does not answer that question.
Consider a fictional B2B workspace product. Organizations invite members, create projects, upload files, and export a report. The architecture should make those actions understandable before it makes them distributed.
This is an illustrative design exercise, not a description of a production system I have scaled.
Start with one customer workflow
Write the first successful journey in plain language: an organization owner invites a member, the member creates a project, and both can read the same report.
Then write the failure journeys. The invitation expires. The upload is interrupted. The export takes too long. A member is removed while a report is generating.
These cases help establish the minimum data model and the boundaries between synchronous requests and background work. They also give founders and engineers a shared definition of done.
A reasonable starting point for this example is an application, an API layer, PostgreSQL, object storage, and a background worker when exports need it. That is a design proposal, not a universal stack requirement. Existing team skills, data constraints, and operating costs should influence the choice.
Define the tenant boundary before adding features
Authentication identifies the caller. Authorization decides whether the caller may perform an action. In a multi-tenant SaaS product, that decision also depends on the organization that owns the resource.
For an endpoint such as GET /organizations/:organizationId/projects/:projectId, the organization ID in the URL is not proof of membership. The server must verify the caller's access and scope the resource lookup to the permitted organization.
An illustrative scoped lookup looks like this:
SELECT id, title, status
FROM projects
WHERE tenant_id = $1 AND id = $2;
Here, the tenant parameter must come from an authorized server-side context. A scoped query is not a complete authorization system by itself.
Test with two organizations from the start. A member of one must not read, update, export, or infer the existence of the other's private resources. Apply the same review to caches, file downloads, and worker jobs, not just the API endpoint.
AWS describes pooled, silo, and bridge storage models. Shared tables can simplify operation, while separate resources can serve stronger isolation needs. Choose based on requirements rather than treating one pattern as automatically correct.
Treat database policies as another boundary
PostgreSQL row-level security can restrict which rows a role accesses. It is not safe to enable a policy and assume every connection is now isolated: table owners and privileged roles can bypass normal policies.
Review the actual application role, connection pooling, and background-worker access. Test the negative cases through the same credentials the application uses. A test performed as an administrator does not prove the application's access boundary.
The PostgreSQL row-security documentation explains these role behaviors. This guide intentionally does not provide a copy-paste tenant policy; the correct policy depends on how your application establishes trusted identity and tenant context.
Separate long work from interactive requests
An export that takes minutes is a different operation from reading a project. Consider returning a job identifier, showing status, and allowing the user to retrieve the result when it is ready.
A worker should carry the authorized tenant context, record useful progress, and handle retries without silently creating duplicate results. Decide how cancellation, failure, and expiry behave. A queue does not remove those product decisions.
For billing or external webhooks, agree on how repeated events are recognized and processed. Store enough state to investigate an event without retaining unnecessary sensitive payloads.
Scale when a measured constraint appears
Before splitting the application, identify the slow path. Is it a query, a file operation, an external API, or a worker backlog? Increasing application instances cannot fix every one of those problems.
For the fictional export workflow, compare request latency with export completion time. Inspect query plans and the size of the work before adding a new service. Set a hypothesis, make one change, and measure the same workflow again.
A service boundary is useful when it solves a specific ownership, resource, or deployment constraint. It also adds interfaces and failure modes. Keep a record of why the boundary exists and what would make you revisit it.
Use a release checklist before your first customer
Check tenant isolation, validation, repeatable builds, backups, recovery, observability, and ownership of incidents. Decide how support can identify a failing workflow without gaining unrestricted access to customer data.
Use the DevOps checklist for SaaS startups for the operational side. If the difficult part is coordinating work rather than raw traffic, the engineering-operations guide addresses that separately.
The aim is not to predict every future scale problem. It is to make the next product decision observable, reversible where possible, and clear to the people building and using the system.