SR-007 — Runtime & Client Framework Selection System Requirements
Metadata
| Field | Value |
|---|---|
| Project Name | Runtime & Client Framework Selection |
| Document ID | SR-007 |
| Author | Engineering Team |
| Status | Draft |
| Traces to | BRD-007 |
This document derives the concrete requirements behind BRD-007 from the runtimes and frameworks actually in use across this monorepo, and names the alternatives each was evaluated against. It does not repeat ADR-00010’s workload-to-language mapping in full — see that ADR, and the five pairwise ADRs it links to, for the full reasoning behind each line below.
1. Functional Requirements (FR)
Backend runtime selection
- FR-01 (Default Backend Runtime): Every domain/CRUD/aggregation microservice, and the platform’s one workflow-orchestration host (
order-service), MUST be built on Go, evaluated against Java (incl. GraalVM-compiled Java) and Node as the named alternatives — satisfying BRD-007’s BR-01 and BR-02. (Detail: ADR-00011.) - FR-02 (Encryption- and Auth-Critical Runtime): Every microservice whose core responsibility is holding decrypted PII/PCI plaintext or verifying a signing key/token on the gateway hot path (
pii-service,pci-service,media-access-service,payment-service,document-service,provider-auth-service,user-secure-engine,notification-service) MUST be built on Rust, evaluated against Go as the named alternative — satisfying BRD-007’s BR-03. (Detail: ADR-00012.) - FR-03 (Pipeline-Orchestration Runtime): Both stages of the tenant-migration pipeline (
tenant-migration,tenant-migration-orchestrator) MUST be built on Node/NestJS, evaluated against Go as the named alternative — satisfying BRD-007’s BR-01 for a non-blocking-I/O-shaped workload specifically, not as a general performance claim against Go. (Detail: ADR-00015.)
Client framework selection
- FR-04 (Customer Mobile Framework): The customer-facing mobile storefront (
ui-application) MUST be built on Flutter, evaluated against React Native and separate native iOS/Android builds as the named alternatives — satisfying BRD-007’s BR-04. (Detail: ADR-00014.) - FR-05 (Admin Console Framework): The tenant/admin management console (
ui-admin-application) MUST be built on React (with MUI and Zustand), evaluated against Angular as the named alternative — satisfying BRD-007’s BR-05. (Detail: ADR-00013.)
2. Non-Functional Requirements (NFR)
-
NFR-01 (Bounded Cold-Start Latency, Backend): A Go or Rust service instance MUST become ready to serve a request within a short, predictable window after process start, without a warm-up phase whose duration varies with accumulated load (the JIT/class-loading behavior a JVM-based alternative would introduce) — satisfying BRD-007’s BR-02.
-
NFR-02 (No Non-Deterministic Secret-Retention Window): Any service satisfying FR-02 MUST NOT rely on a garbage-collected runtime to reclaim memory that held decrypted PII/PCI plaintext — reclamation timing MUST be deterministic, tied to the owning value going out of scope, not to a GC cycle running at an unpredictable point in time — satisfying BRD-007’s BR-03. (Gap — no automated test currently asserts secret-buffer zeroing on drop in the Rust services; tracked as a candidate technical-debt entry once a concrete verification approach is scoped.)
-
NFR-03 (Single Codebase per Client Target):
ui-applicationMUST ship from one Flutter codebase to both iOS and Android, andui-admin-applicationMUST ship from one React codebase to every supported admin browser — neither client target MUST require a second, platform-specific codebase to stay in sync — satisfying BRD-007’s BR-04 and BR-05. -
NFR-04 (Technology-Choice Count Stays Traceable): Every backend runtime or client framework in active use MUST trace to a specific FR above, each backed by its own ADR naming the alternatives it was evaluated against — satisfying BRD-007’s BR-06. A new runtime or framework choice MUST NOT be introduced without a new FR/ADR pair showing an existing choice could not meet FR-01 through FR-05 for that workload.
-
NFR-05 (Common Coding Pattern Enforcement Across Languages): Regardless of which runtime or client framework FR-01 through FR-05 assigns to a given workload, every one of them MUST converge on the same layering shape (domain/repository/service/transport), the same cross-cutting mechanics (logging, error handling, tracing, metrics, security), and the same DTO/validation/no-over-engineering conventions — documented once per language in the Coding Standards section rather than left to drift per service. This convergence MUST be enforced through the same documented rule files and per-language/per-store templates (this monorepo’s central
.claude/rules/*.mdand@templates/*) that both human contributors and AI-assisted code generation are required to read and follow before writing any new service code — not through code review alone catching drift after the fact. This is what keeps a five-runtime platform’s engineering and onboarding cost close to what a single-runtime platform would cost, satisfying BRD-007’s BR-06: the number of distinct technology choices stays supportable because the pattern every one of them follows is templated and machine-enforceable, not five independently-maintained conventions.Coding Standard doc What it standardizes Layered Architecture Across Languages The shared domain/repository/service/transportfolder shape, common coding patterns, client feature triadsCross-Cutting Principles Across Languages Logging, exception handling, tracing, metrics, security — one mechanism per language, mapped side by side Go / Rust / Node / Flutter / React The concrete, per-language rulebook each service/app is actually held to (Gap — no automated linter currently fails a build for violating a Coding Standards doc’s rule; today this is enforced by the rule files being the required reading before any code is generated, plus code review, not by tooling. Tracked as a candidate technical-debt entry once a concrete enforcement mechanism, e.g. a custom lint rule per language, is scoped.)
Related Documents
- BRD-007 — Runtime & Client Framework Selection
- ADR-00010 — Polyglot Language & Runtime Selection
- ADR-00011 — Go vs Java vs Node: Default Backend Runtime
- ADR-00012 — Rust vs Go: Security-Critical Services
- ADR-00013 — React vs Angular: Admin Console
- ADR-00014 — Flutter vs React Native vs Native: Mobile App
- ADR-00015 — Node vs Go: Migration Pipeline Runtime
- Layered Architecture Across Languages
- Cross-Cutting Principles Across Languages