Skip to content

ADR-004 — Modular Monolith First

Status: ACCEPTED — I1-B1 Technology Decision Gate
Accepted: 2026-09-21

Context

Touriffique already carries substantial product-domain redesign, multi-tenancy, authorization, commerce and migration complexity. Splitting engines into network services at launch would add distributed transactions, operational coordination, failure modes and deployment overhead before those costs are justified.

The engine boundaries defined by the architecture remain important even when the initial implementation is one backend application.

Decision

The initial Touriffique backend is a modular monolith with explicit engine ownership and internal application contracts.

The initial backend deployment model is:

touriffique-bend
├── API runtime
└── background worker runtime(s)

The API and workers use the same backend codebase and domain/application modules, but may be deployed and scaled independently.

No engine is required to be a network microservice at launch.

Cross-engine interaction must preserve explicit module/application boundaries. Sharing one process or database deployment is not permission for arbitrary cross-engine repository/table access.

Service extraction is permitted later when justified by evidence such as:

  • independent scaling requirements;
  • materially different reliability/SLA requirements;
  • independent release cadence;
  • security/isolation requirements;
  • clear organizational ownership;
  • infrastructure constraints that justify distributed deployment.

Non-decisions

This ADR does not choose:

  • backend language/runtime/framework;
  • database product;
  • ORM/data-access library;
  • queue technology;
  • event broker;
  • deployment/cloud provider.

Those belong to later I1-B gates.

Consequences

  • lower launch operational complexity;
  • domain boundaries must be enforced in code/tests rather than by network boundaries;
  • API and worker processes can scale independently without creating separate domain repositories;
  • future extraction has deliberate seams but is not assumed;
  • distributed-system infrastructure is introduced only when a demonstrated requirement justifies it.