For a minimum viable product (MVP), record five architecture decisions early: module boundaries, data ownership and tenancy, API contracts, production visibility and recovery. They affect how the team can change the next release. A modular application is a useful starting point when its boundaries fit the work and the team can operate it.
Here, MVP means a minimum viable product, not the Model-View-Presenter interface pattern. The defaults below are TecnoStack’s engineering guidance for small product teams in Saudi Arabia and the GCC. Check them against actual constraints rather than treating them as a universal architecture or a growth guarantee.
The hardest to reverse are the ones customers, partners and stored data come to depend on. You can usually swap a cache library or a logging tool in a contained change. Untangling modules that read each other’s tables, or changing tenant isolation, can affect existing integrations, stored records and recovery procedures.
Use reversibility as your test. A plan built around "what happens at 100,000 users" guesses at problems the product may never have.
| Decision | Good-enough MVP default | Why it is costly to change later | Revisit when |
|---|---|---|---|
| Module boundaries | One deployable app, one module per business capability | Hidden cross-module calls and shared tables spread through the code | A module needs its own scaling, release schedule or team |
| Data ownership and tenancy | One owning module per table; tenancy model chosen before the first business customer | Every query, migration and export assumes the model | A tenant needs different isolation, residency or export terms |
| API and event contracts | OpenAPI file, versioning policy, idempotent writes | Partners and installed app versions depend on them | Before the first external integration ships |
| Observability | Structured logs with request IDs, journey metrics, symptom alerts | Without history you cannot compare before and after a change | Incidents take guesswork, or alerts fire with nothing to do |
| Rollout and rollback | Pipeline deploys, feature flags, written rollback that covers data | Irreversible data changes turn a bad release into an incident | People start avoiding releases |
Start with a modular monolith: one deployable application divided into modules named after business capabilities, such as catalogue, orders, billing and accounts. Martin Fowler’s “Monolith First” essay explains the operating overhead of early microservices and the difficulty of finding stable boundaries. It also acknowledges limited evidence and exceptions; use that reasoning to assess your context, not as proof that every product must follow one route.
A modular monolith only works if the boundaries are real:
- Modules call each other through small public interfaces, never by reaching into another module's classes or tables.
- Shared code holds generic utilities and no business rules.
- A dependency check in the build fails when code crosses a boundary, so the rule survives a deadline week.
If a module later needs to scale, deploy or change on its own, its boundary is already drawn. Extraction still means redesigning transactions, latency and failure handling for a network call, so a clean boundary shortens that work without removing it.
The pattern works in any mainstream framework. Choosing a backend stack is a separate decision, best made on your team's skills and each framework's support window.
Figure 1: Organize around business capabilities. Start with a modular application.
Give every business table one owning module, and choose your tenancy model before the first business customer signs. The model shapes every query, migration, backup and security review that follows.
One owner per table means only that module writes to it. Other modules ask through its interface or react to its events. Shared workflows still need explicit design, but nobody discovers six months later that three modules update the same orders row.
| Tenancy model | Isolation | Operating cost | Usually fits |
|---|---|---|---|
Shared tables with a tenant_id column | Requires complete application and database access controls | Shared schema simplifies some operations; tenant restores need design | Tenants with compatible requirements |
| Schema per tenant | Separation depends on credentials, grants and shared infrastructure | Migrations and lifecycle operations cover every schema | Cases where schema-level organisation helps operations |
| Database per tenant | Separate database access; host, identity and service isolation still matter | Automation, backups and monitoring must cover each database | Requirements that justify separate database lifecycles |
Enforce the tenant filter in one place
In shared tables, one forgotten WHERE tenant_id = … is a data leak. Put the filter where every query passes: a repository layer, database policies, or both. In PostgreSQL 18, enabling row-level security without an applicable policy gives default-deny behaviour for normal row access. Superusers and roles with BYPASSRLS bypass it; table owners normally do too unless FORCE ROW LEVEL SECURITY applies. Whole-table operations such as TRUNCATE are outside row-security policies. Connect the application with a role that cannot bypass the policies.
Whichever model you pick, write tests that try unauthorised cross-tenant reads and writes through the API, caches, background jobs, search indexes and exports.
Plan migrations and restores before launch
Ship schema changes as backward-compatible steps: add the new column, backfill it, switch reads, and drop the old column in a later release. Define and test how writes keep both representations consistent during the overlap, including changes made while the backfill runs, before switching reads or removing the old field. Old and new code can then run side by side during a deployment or a rollback. Before launch, restore a backup into a scratch environment on purpose, on a quiet day, so the first restore is not during an outage.
Write down every interface that something outside a module depends on: external APIs, events and third-party integrations. Contracts let a mobile app, a partner or a future service keep working while the code behind them changes.
- External APIs. Describe them in an OpenAPI file (3.2.1 is the published specification checked on 24 October 2026; confirm your tooling supports the chosen version) and decide your versioning policy before the first partner integrates. If you are building your MVP as an app, treat the API as public from the first release, because older app versions stay on people's phones long after you ship a new one.
- Idempotent writes. Define how retries avoid a second order or payment. Stripe’s API v1 records the first result after execution begins and returns it for matching retries, subject to its documented key lifetime and concurrency rules. Its API v2 has different retry semantics. For local writes, keep the deduplication decision and outcome consistent with the transaction; external payments or messages also need provider-aware retries and reconciliation. A database transaction cannot atomically include an unrelated external service.
- Events. Give each event a documented schema and an owner, and treat changes like API changes. Consumers must handle duplicates and follow a stated ordering policy.
- Third-party providers. Wrap payment, messaging and similar services behind your own adapter, so provider-specific code lives in one place. Switching providers can still mean data migration, token replacement and end-to-end testing, while downstream workflows still need review; the adapter contains provider-specific code, not every consequence of the switch.
Enough to answer two questions without guessing: what is broken, and why. Google's SRE book frames monitoring around exactly those two questions, and they are a fair bar for a first production release.
- Structured logs with a request ID that follows each request across modules and background jobs. The W3C Trace Context
traceparentheader standardises propagation of tracing context between services; relate it to your application’s request identifiers rather than assuming they are the same field. - Metrics for the few journeys that pay the bills, such as sign-up, checkout or booking, using the SRE book's four golden signals: latency, traffic, errors and saturation.
- Traces for slow or failing requests, so you can see which step took the time.
- Alerts on symptoms users would notice. The SRE book advises putting far more effort into catching symptoms than causes; page someone for failed checkouts and leave internal warnings on a dashboard.
OpenTelemetry gives you one vendor-neutral way to emit traces, metrics and logs, which reduces dependence on one monitoring backend; exporter configuration and compatibility still need review when changing tools. Keep personal data out of logs or mask it, and set retention limits. If you would rather not run this yourself, server operations and monitoring can sit in a managed set-up, with monitoring, backups and response procedures written down for your team.
Ship small changes through an automated pipeline, separate deploying code from releasing features, and write down how each release rolls back, including the data it writes.
- Run automated tests and deploy through a pipeline, never by hand from a laptop.
- Use feature flags, so you can switch a feature off without redeploying.
- Release gradually where you can: internal users first, then a small share of traffic.
- Write the rollback before the release, and say what happens to records the new version created.
Redeploying the old version does not undo database writes, payments or messages already sent. Keep schemas compatible with the versions that must remain usable, plan reconciliation or compensating actions, and delay destructive clean-up until you have verified recovery. The same thinking scales up to a full migration, which our guide to cutover and rollback planning walks through.
Figure 2: Observe each controlled rollout. Plan recovery for data too.
Revisit the five decisions at fixed points, such as before a major launch or a funding round, and whenever the evidence changes. Signals worth acting on:
- A module needs to scale or deploy on a different schedule from the rest.
- Two teams keep colliding in the same part of the codebase.
- A tenant's data, isolation or compliance needs differ from everyone else's.
- One journey's latency or error rate dominates your dashboards.
For the review itself, the six pillars of the AWS Well-Architected Framework (operational excellence, security, reliability, performance efficiency, cost optimization and sustainability) make a useful checklist even if you never use an AWS service. When a module does need to leave, the strangler fig pattern puts a proxy in front of the system and moves traffic to the new component one route at a time. AWS's guidance adds a caveat: for a small application, a complete rewrite can be more efficient than incremental migration.
A decision record for the next release
Use this original example for a hypothetical visit-request product. The team needs assignment and completion, has one delivery team and has not demonstrated a need for independent deployment. Those are example assumptions, not findings about your organisation.
| Decision-record field | Illustrative entry |
|---|---|
| Decision and boundary | Keep visit assignment in one deployable application with a named owning module |
| Alternative considered | Separate assignment service with its own network and release boundary |
| Reason for this release | One team needs a complete workflow; independent release needs are unproven |
| Consequence accepted | The application deploys together; module access rules must be enforced |
| Acceptance evidence | Repeated assignment requests, forbidden cross-tenant access and a recovery rehearsal |
| Revisit trigger | Observed release conflicts or measured workload isolation needs, with an owner to investigate |
The evidence should test the decision’s consequences. Retry the same intended assignment and inspect the final record. Attempt an unauthorised tenant read through an export and a background job, not only the web screen. Rehearse recovery after the new version writes data, using an isolated environment with external side effects controlled.
A failing test identifies work to resolve; it does not automatically justify splitting the application. Record the failure, cause, proposed change and trade-off. If a separate service becomes justified, add its network failure, data consistency, deployment and operating responsibilities to the next decision record. Link these checks to the software requirements brief so the architectural choice supports an accepted task.
Two decisions come before architecture: whether to build at all, and who builds it.
- Check whether a SaaS product already covers the need, using our framework for choosing between SaaS and custom software.
- If you hire a partner, ask how they handle these five decisions and judge the answers on artefacts: a sample OpenAPI file, a cross-tenant test, a rollback runbook. Our guide to comparing software vendors on evidence lists what to request.
- Include both feature scope and operating architecture in the proposal. See app budgets by scope for the questions that shape an app brief.
- Modules named after business capabilities, with a boundary check in the build.
- One owning module per table, a written tenancy model and cross-tenant tests in CI.
- Backward-compatible migrations, and one backup restored on purpose.
- An OpenAPI file, a versioning policy and idempotent writes before the first integration.
- Request IDs across modules, golden-signal metrics for key journeys and symptom-based alerts.
- Pipeline deploys, feature flags and a written rollback that covers data.
- A review date in the calendar.
TecnoStack’s custom software service can scope a first release and its operating handover. Bring the workflow, dependencies and known constraints. For the delivery process itself, use the CI/CD guide and deployment recovery plan to agree evidence and ownership.
- Martin Fowler. MonolithFirst (3 June 2015): why new systems usually start as a monolith.
- PostgreSQL Global Development Group. Row Security Policies, PostgreSQL 18 documentation: default-deny,
BYPASSRLSandFORCE ROW LEVEL SECURITY. - OpenAPI Initiative. OpenAPI Specification versions: published specification 3.2.1; tooling support must be checked.
- Stripe. Idempotent requests: API-version-specific retry semantics and key rules.
- Google. Monitoring Distributed Systems, Site Reliability Engineering: the four golden signals and alerting on symptoms.
- OpenTelemetry. Signals: traces, metrics and logs.
- Amazon Web Services. The pillars of the framework, AWS Well-Architected Framework.
- Amazon Web Services. Strangler fig pattern, AWS Prescriptive Guidance: proxy-based incremental migration and when a rewrite is simpler.
We checked these sources on 24 October 2026. The five decisions and their defaults are TecnoStack's engineering guidance, not requirements from AWS, Google or any other vendor.




