Building a successful SaaS product is a marathon of compounding decisions. The right architectural and commercial choices made in the first few months can mean the difference between a scalable, profitable global service and a system that buckles under its own complexity. Many founders focus intently on the initial product-market fit, which is essential, but they often underestimate the engineering foundations required to service that fit at scale.
At Golux Group, we partner with companies to build these foundations. We've seen firsthand how early, deliberate choices in tenancy, billing, and security architecture pay dividends for years. This is not about chasing the latest technology trend; it's about applying proven patterns to build a robust, maintainable, and commercially viable product. This guide distills our experience into the critical engineering and product decisions you will face on the journey from idea to a global SaaS platform.
SaaS architecture decisions taken in month one
The code you write in the first few weeks sets the trajectory for the next several years. While speed is critical, it should not come at the expense of structural integrity. The most common mistake we see is conflating a Minimum Viable Product (MVP) with a throwaway prototype. A SaaS MVP must be built on a production-ready foundation.
The debate between monoliths and microservices is a frequent starting point. For a new SaaS product, we almost always advise against starting with a distributed microservices architecture. The upfront operational overhead, network latency concerns, and complexity of distributed transactions are a significant drag on a small team trying to find market fit.
Instead, we advocate for a "majestic monolith." This is a single codebase and a single deployable unit, but it is architected with clear, logical boundaries between its components (e.g., identity, billing, application core). This approach offers the development speed of a monolith while making it straightforward to extract a well-defined component into a separate service later, when scale or team structure demands it. This initial focus on high-quality software engineering within a monolithic structure is the most pragmatic path to market.
Your choice of database is another foundational pillar. The decision between SQL (like PostgreSQL) and NoSQL (like MongoDB) should be driven by your data's structure and expected access patterns, not by trend. For most SaaS applications, which deal with structured relational data (users, organisations, subscriptions, projects), PostgreSQL is an exceptionally powerful and reliable default choice. Its support for JSONB columns even provides flexibility for semi-structured data, offering the best of both worlds. Starting with a solid relational model forces clarity of thought about your business domain.
Finally, the initial user experience is paramount. A powerful backend is useless if the frontend is confusing or slow. Investing in a modern, component-based web development framework like React or Vue, coupled with a deliberate design system, ensures you can build an intuitive and responsive interface that will evolve with your product.
Multi-tenancy models compared
Multi-tenancy is the economic engine of SaaS. It is the practice of serving multiple customers (tenants) from a single instance of your software and infrastructure. A robust multi-tenancy strategy is what allows you to add the 1000th customer for a marginal cost that is a fraction of the first. The core challenge is ensuring absolute data isolation: no tenant should ever be able to access another tenant's data.
We see three primary models for implementing multi-tenancy at the database level.
+------------------------------------+ +------------------------------------+ +------------------------------------+
| Application | | Application | | Application |
+------------------------------------+ +------------------------------------+ +------------------------------------+
| Single Database | | Single Database | | Database per Tenant |
| +--------------------------------+ | | +--------------+ +--------------+ | | +----------+ +----------+ +-----+ |
| | Shared Schema | | | | Schema A | | Schema B | | | | DB A | | DB B | | ... | |
| | | | | | (Tenant A) | | (Tenant B) | | | |(Tenant A)| |(Tenant B)| | | |
| | table_A (..., tenant_id) | | | +--------------+ +--------------+ | | +----------+ +----------+ +-----+ |
| | table_B (..., tenant_id) | | | +--------------+ +--------------+ | +------------------------------------+
| | ... | | | | ... | | ... | |
| +--------------------------------+ | +------------------------------------+ Model 3: Separate Databases
| |
| Model 1: Shared Schema (row-level) | Model 2: Separate Schemas
+------------------------------------+
-
Shared Database, Shared Schema (Row-Level Isolation): This is the most common and, for most new SaaS products, the recommended model. All tenants' data resides in the same set of tables, and a
tenant_idcolumn on every relevant table enforces isolation. Application logic must be written to automatically add aWHERE tenant_id = ?clause to every single database query. This offers the best cost-efficiency and simplifies management. The primary risk is a bug in the application code leading to a cross-tenant data leak. -
Shared Database, Separate Schemas: In this model, each tenant is given their own schema (a named collection of tables) within a single database instance. When a user authenticates, the application sets the database connection's search path to that tenant's schema. This provides stronger logical isolation than the row-level model, making accidental cross-tenant data access much harder. However, it introduces complexity in managing database migrations (which must be applied to every schema) and can make cross-tenant analytics more difficult.
-
Separate Databases: This model provides the highest level of isolation by provisioning an entirely separate database instance for each tenant. This is often required by large enterprise customers or specific regulations that mandate physical data segregation. While it offers maximum isolation and eliminates the "noisy neighbour" problem (where one tenant's heavy usage impacts others), it is by far the most expensive and operationally complex. Managing connections, backups, and migrations across hundreds or thousands of databases is a significant engineering challenge.
For most businesses, the right choice is clear. You should only add complexity when a commercial or regulatory requirement forces you to.
Table: Comparison of Multi-tenancy Architectures
| Attribute | Shared Schema (Row-Level) | Separate Schemas | Separate Databases |
|---|---|---|---|
| Cost Efficiency | Very High | High | Low |
| Data Isolation | Low (Application-enforced) | Medium (DB-enforced logical) | Very High (Physical) |
| Dev Complexity | Low | Medium | High |
| Operational Overhead | Low | Medium | Very High |
| Resource Pooling | Excellent | Good | None |
| Best For | Most B2B/B2C SaaS, Startups | SaaS with mid-market clients needing higher isolation guarantees | Enterprise-only SaaS, regulated industries (Fintech, Healthtech) |
| Golux Recommendation | Default choice for 95% of new products. | A valid choice if early customers demand stronger logical isolation than row-level. | Avoid unless explicitly required by a multi-million EUR contract or specific regulation. |
Billing, entitlements and plan changes
Integrating billing and managing entitlements seems straightforward until you dig into the details. A common early-stage mistake is to code billing logic directly against a payment provider's API, like Stripe's. This creates tight vendor lock-in and makes future evolution incredibly difficult.
We strongly recommend building an internal "billing abstraction layer." This service in your monolith translates your internal product concepts (plans, add-ons, usage metrics) into the specific API calls of your chosen payment provider. Its responsibilities are:
- Plan Management: Maintaining the definition of your plans (
basic,pro,enterprise) and the entitlements (feature flags, resource limits) associated with each. - Subscription Lifecycle: Handling new subscriptions, cancellations, and crucially, upgrades and downgrades.
- Payment Gateway Integration: Containing all the code that talks to the external provider (e.g., Stripe, Adyen, GoCardless).
If you later need to add a new payment method, support invoicing for enterprise clients, or even switch payment providers, you only need to modify this single layer, not comb through your entire codebase.
Handling plan changes correctly is a hallmark of a mature billing system. Proration—charging a customer fairly when they change their plan mid-cycle—is essential.
Worked example: Prorated plan upgrade
Let's model a scenario for a B2B analytics platform in 2026.
- Client: A marketing agency on the "Pro" plan.
- Cost: €100 per month.
- Billing Cycle: Renews on the 15th of each month.
- Event: On the 25th of March (10 days into their 30-day cycle), they upgrade to the "Business" plan at €300 per month to get access to a new reporting feature.
A naive implementation might simply charge them €300 and start a new cycle. A correct, prorated implementation does this:
- Calculate unused credit from the "Pro" plan:
- The client used 10 out of 30 days of their "Pro" plan.
- They have 20 days of unused service, valued at (€100 / 30) * 20 = €66.67.
- Calculate the cost of the "Business" plan for the remainder of the cycle:
- The cost of the "Business" plan for the remaining 20 days is (€300 / 30) * 20 = €200.00.
- Determine the immediate charge:
- The immediate charge is the cost of the new plan minus the unused credit: €200.00 - €66.67 = €133.33.
- Update the subscription:
- The customer is charged €133.33 immediately.
- On the next billing date (April 15th), their subscription renews at the full €300 for the "Business" plan.
This logic ensures fair billing and prevents customer support tickets. Building this capability from the start is a wise investment.
Security and compliance: SOC 2, GDPR, data residency
For any SaaS product targeting business customers, security isn't a feature; it's a prerequisite for sales. Enterprise buyers will not engage without evidence of a mature security posture. While you may not need to complete a full SOC 2 audit in your first year, your architecture must be compliance-ready.
SOC 2 (Service Organization Control 2) is an auditing procedure that ensures a service provider securely manages data to protect the interests and privacy of its clients. It's based on five trust service principles: security, availability, processing integrity, confidentiality, and privacy. From an engineering perspective, preparing for SOC 2 means:
- Robust Access Control: Implementing Role-Based Access Control (RBAC) for your own team's access to production systems. Not every engineer needs database access.
- Audit Logging: Logging every significant action within the system (who accessed what data, who changed what setting, when).
- Change Management: Having a formal process for reviewing, testing, and deploying code changes.
- Vendor Management: Vetting the security of your own subprocessors (e.g., your cloud provider, logging service).
GDPR (General Data Protection Regulation) has direct implications for your product architecture. Key rights like the "right to access" and the "right to be forgotten" (erasure) must be engineered into the system. A multi-tenancy model with a clear tenant_id makes this manageable. Fulfilling a deletion request becomes a matter of deleting all rows associated with that tenant_id, rather than hunting through disparate records.
Data Residency is an increasingly common requirement, particularly from European clients in government, finance, and healthcare. They may contractually require that their data never leaves EU borders. A naive, single-region deployment (e.g., in us-east-1) makes it impossible to serve these clients.
The solution is to architect for regional deployments, or "pods." This involves designing your application to run independently in different geographic regions (e.g., an EU pod in Frankfurt, a US pod in Virginia). This requires careful planning around data replication (if any is needed between pods), configuration management, and deployment pipelines. The architectural patterns for this are non-trivial, and we have helped several clients, from fintech scale-ups to established enterprises, navigate this complexity. Our case studies detail some of these engagements.
Onboarding, activation and product analytics
The first few minutes a user spends with your product are the most critical. A clunky, confusing onboarding experience will lead to immediate churn, no matter how powerful the underlying features are.
Onboarding is an engineering challenge that requires deep collaboration with product design. It's not just a series of modals; it's a state machine that guides a user from sign-up to their "Aha!" moment—the point where they first experience the core value of your product.
To build an effective onboarding flow, you must instrument your product for analytics from day one. This involves:
- Defining Key Activation Metrics: What specific actions indicate a user is engaged? For a project management tool, it might be "Created first project AND invited a team member." For an analytics tool, it might be "Installed tracking snippet AND built first dashboard."
- Implementing Event Tracking: Using a tool like Segment, Mixpanel, or the open-source PostHog to send events from your frontend and backend. These events should capture user actions (
project_created,user_invited) and system events (billing_invoice_paid). - Building Funnels: Using an analytics tool to visualise the user journey through the onboarding steps. This will immediately highlight where users are dropping off. If 80% of users who sign up fail to create their first project, you know exactly where to focus your engineering and design efforts.
A good onboarding flow often involves sample data, guided tours, and contextual tips. These are not just UI elements; they require backend logic to manage the state of the onboarding process for each user and to clean up sample data after it has served its purpose. Understanding these flows is a core component of effective custom software development.
Reliability, SLAs and support tiers
As your SaaS product matures, customers will depend on it. Reliability ceases to be an abstract goal and becomes a contractual obligation, often codified in a Service Level Agreement (SLA).
An SLA typically promises a certain level of "uptime," expressed as a percentage. It's vital to understand what these percentages mean in practice and what engineering effort is required to achieve them.
Table: Uptime SLAs and Required Engineering
| Uptime % | Max Downtime (per month) | Required Architecture & Operations |
|---|---|---|
| 99.0% ("Two nines") | 7.31 hours | Single server, manual recovery, basic monitoring. Acceptable for internal tools or pre-launch products. |
| 99.9% ("Three nines") | 43.83 minutes | Redundant application servers (e.g., 2+ EC2 instances behind a load balancer), managed database with failover replica, automated alerting. The standard for most commercial B2B SaaS. |
| 99.95% | 21.92 minutes | Multi-Availability Zone (AZ) deployment for all critical components (app servers, DB, cache). Automated failover testing (chaos engineering). |
| 99.99% ("Four nines") | 4.38 minutes | Multi-region deployment with automated, latency-based routing and data replication. Dedicated Site Reliability Engineering (SRE) team. Significant cost and complexity. |
What we would NOT do: We would never advise a seed-stage company to promise or build for "four nines" of uptime. The cost and engineering effort far outweigh the benefits. The sweet spot for most SaaS businesses is 99.9%, which provides a high degree of reliability without excessive operational burden. For a deeper dive into these concepts, our guide to modern software architecture is a valuable resource.
Engineering also plays a critical role in enabling tiered support. To prevent every customer query from escalating to a senior engineer, your team must build internal tools:
- Admin Panel: A secure interface where Tier 1 support can look up customer information, view their entitlements, and perform basic actions (like resending an invitation or clarifying a bill).
- Centralised Logging: A tool (like Datadog, Logz.io, or an ELK stack) that allows support to search logs for a specific
tenant_idoruser_idto trace errors without accessing production servers.
Scaling internationally: latency, currency, localisation
Taking a SaaS product global introduces three new dimensions of complexity: speed, money, and language.
Latency: A user in Sydney accessing a server in Ireland will have a fundamentally slower experience than a user in London. While a CDN (Content Delivery Network) can cache static assets close to the user, dynamic API calls must still travel back to your origin servers. To solve this, you must move your application logic closer to your users. This means evolving your single-region deployment to a multi-region one, as discussed under data residency.
Worked example: Cost of a US expansion
Let's estimate the monthly infrastructure and engineering cost for a European SaaS company to establish a presence in the US market in 2026.
- Baseline EU Deployment:
- Infrastructure (2 app servers, 1 managed PostgreSQL DB, cache, load balancer in Frankfurt): €3,500/month
- New US-East Deployment (Read-Heavy):
- Infrastructure (2 app servers, 1 PostgreSQL read-replica, local cache, load balancer in Virginia): +€2,800/month
- Additional Engineering Overhead:
- Managing multi-region deployments, latency-based routing (e.g., via Route 53), and ensuring data consistency with a read-replica requires dedicated engineering time.
- We estimate this at ~0.25 of a senior DevOps/SRE engineer's time.
- Assuming a fully-loaded cost of a senior engineer in a nearshore location like Belgrade is ~€144,000/year (€12,000/month), this adds: 0.25 * €12,000 = +€3,000/month
- Total Incremental Cost for US Expansion: €2,800 + €3,000 = €5,800/month
This €70,000 annual investment is a strategic decision that must be justified by the expected revenue from the new market.
Currency: Supporting multiple currencies is not just about changing the symbol in the UI. You must be able to define pricing per currency, integrate with a payment gateway that can process those currencies, and handle accounting and tax compliance correctly for each region.
Localisation (l10n) and Internationalisation (i18n): Internationalisation is the process of engineering your application so that it can be adapted to various languages and regions without engineering changes. Localisation is the process of actually translating content for a specific region. You must internationalise from day one. This means no hardcoded text in the source code; every user-facing string must be retrieved from a locale file (e.g., en-GB.json, de-DE.json). Retrofitting i18n into an existing application is an expensive and painful process.
Unit economics engineering can influence
Engineering decisions have a direct and measurable impact on the financial health of a SaaS business. CTOs and engineering leaders must be able to connect their architectural choices to core business metrics.
- Cost of Goods Sold (COGS): This is the cost of running the infrastructure needed to serve your customers. Your choice of multi-tenancy model is the single biggest driver of this. A shared schema model allows you to serve hundreds of tenants from a single database, keeping per-customer COGS extremely low. Inefficient code, N+1 query bugs, and over-provisioned infrastructure all bloat your COGS and erode your gross margin.
- Customer Acquisition Cost (CAC): A seamless, self-service onboarding flow, engineered for low friction, can dramatically lower your CAC. When users can sign up, understand the value, and start paying without ever talking to a salesperson, your sales and marketing spend becomes far more efficient.
- Lifetime Value (LTV): LTV is a function of your average revenue per customer and your churn rate. Engineering influences both. High reliability and performance reduce churn. A consistent pace of shipping valuable new features (enabled by a clean, maintainable codebase) increases your ability to upsell customers to higher tiers, boosting revenue. The cost of development itself is also a factor, which can be better understood by looking into breakdowns of how much custom software development costs.
Ultimately, great engineering in a SaaS context is about building a product that is not just functional, but economically efficient to scale.
Frequently asked questions
What multi-tenancy model should a new SaaS use?
For the vast majority of new SaaS products, the clear answer is to start with a shared database and a shared schema, using row-level isolation via a tenant_id column. This model is the most cost-effective, the simplest to manage, and the fastest to build, allowing your team to focus on delivering product features. It scales perfectly well for most use cases. You should only deviate from this path and consider separate schemas or databases if a major enterprise contract or specific industry regulation (like in healthcare or finance) explicitly mandates a higher degree of data segregation. Treat that additional complexity as something you must earn.
Key takeaways
- Start with a well-structured "majestic monolith." It offers development speed without sacrificing future scalability. Avoid microservices until you have a clear business need.
- Your multi-tenancy model is a core business decision. For most SaaS products, a shared database with row-level isolation (
tenant_id) provides the best balance of cost, performance, and simplicity. - Build an abstraction layer for billing. It will save you from vendor lock-in and allow you to easily add new payment methods, plans, and pricing models in the future.
- Architect for compliance and security from day one. Even if you aren't getting a SOC 2 audit immediately, your systems should be built with logging, access control, and data lifecycle management in mind.
- International scaling is an architectural challenge. Plan for multi-region deployments, multi-currency billing, and internationalisation (i18n) early, as retrofitting them is extremely expensive.
- Engineering decisions directly impact unit economics. From infrastructure COGS to reducing churn through reliability, every technical choice has a financial consequence.
The journey of building a SaaS product involves navigating a series of critical technical and business trade-offs. Making the right choices early on sets the stage for sustainable growth and a product that can win on a global scale.
If you are navigating these decisions and need an experienced engineering partner to accelerate your journey and ensure your architecture is built for scale, we can help.

