ADR-0001 — Architecture style: modular monolith first, services by extraction

Context

The brief mandates a microservice architecture. BitVault has zero users at the start. Microservices solve organizational and independent-scaling problems (many teams, divergent scaling/deploy profiles) — none of which exist yet. Adopting them on day one buys distributed-systems failure modes (partial failure, network latency, eventual consistency, distributed debugging) and ops overhead without the benefits, and is the most likely way the project stalls in plumbing before the core sync product ships (see Overengineering Ledger).

At the same time, demonstrating microservices, eventing, and Kubernetes is an explicit goal of the project.

Decision

Build a modular monolith (bitvaultd): a single deployable composed of modules aligned 1:1 with bounded contexts (04). Each module exposes a gRPC API and app/domain/repo layers from day one, and communicates with others only through that API or through domain events — never by importing another module’s internals (07 §4).

Microservices is the target architecture, reached by extraction when a documented forcing function appears (05 §5). Because callers already use the gRPC API and events, extraction changes deployment topology, not callers.

The monolith → services migration is itself a primary portfolio deliverable.

Consequences

Positive

Negative / costs

Alternatives considered

Compliance / how we keep ourselves honest