Skip to content

Requirements, Trade-offs, and the C4 Model

Good system design clarifies the problem and success criteria before drawing the solution. Requirements make user value, operational limits, and the reasons behind architecture decisions visible.

Quick Decision

SituationToolOutput
Problem is unclearStakeholder interviews and user journeysProblem statement and scope
Behavior must be definedFunctional requirementsUse case, API, or event contract
Quality limits must be setNon-functional requirementsSLI/SLO, latency, capacity, and security targets
Architecture must be explainedC4 modelContext, container, component, and deployment views
Alternatives competeTrade-off recordDecision, rejected option, and reversal condition

Production Checklist

  • Are requirement owners, priorities, and validation methods explicit?
  • Are functional and non-functional requirements kept separate?
  • Are latency, availability, throughput, retention, and security targets numeric?
  • Do C4 diagrams use the same system boundary and naming?
  • Does every trade-off cover cost, performance, complexity, and failure modes?

Functional and Non-Functional Requirements

A functional requirement says what the system does: “A user can create a playlist” or “A successful payment publishes an order event.”

A non-functional requirement says with which quality and limits it does so:

AreaExample
LatencyAPI p95 stays below 200 ms
AvailabilityMonthly success rate is 99.9%
Throughput50,000 orders during the peak hour
DurabilityA successful payment must not be lost
SecuritySensitive data is encrypted and auditable
OperabilityCritical failures are detected within five minutes
ComplianceData remains in an approved region

If an NFR cannot be measured, the design decision and its test result remain ambiguous.

Requirements Gathering and Documentation

Start with these questions:

  1. Who is the user and which flow are they trying to complete?
  2. How are success and failure recognized?
  3. What are traffic, data volume, growth, and peak behavior?
  4. Which data is critical, who owns it, and how long is it retained?
  5. What latency, error, and consistency are acceptable?
  6. What security, regulatory, and operational constraints apply?

A simple requirements record can contain:

text
Problem: What user problem exists?
Actors: Users, systems, and owners
Functional scope: Behaviors to implement
Quality targets: p95, availability, throughput, durability
Data: Entities, source of truth, retention, privacy
Failure behavior: Timeout, retry, duplicate, degradation
Acceptance: Measurable test and observation conditions
Open decisions: Assumptions and owners

Trade-off Analysis

Use the same questions for every alternative:

DimensionQuestion
CostWhat are infrastructure, operations, and data-transfer costs?
PerformanceWhich latency or throughput target improves?
ComplexityHow many new components, contracts, and failure modes appear?
ConsistencyAre stale or duplicate results acceptable?
OperabilityHow do deploy, debug, backup, and incident response change?
ReversibilityHow difficult is it to undo the decision?

The cheapest or fastest option is not automatically the best one. Record the choice with requirement weights and reversal conditions.

The C4 Model

C4 explains the same architecture at different zoom levels:

  1. Context: Users, the system, and external systems.
  2. Container: Deployable applications, databases, queues, or workers.
  3. Component: Modules and responsibilities inside a container.
  4. Code: Class or function detail when it is useful.
  5. Deployment: Nodes, regions, clusters, and network placement.

Each diagram should make scope, naming, relationship direction, and data flow clear. Do not fill a container diagram with component detail or a component diagram with every class.

Design Document Order

Recommended order: problem and requirements → traffic/data assumptions → context → containers → critical components → data and communication decisions → failure/observability → trade-offs and rollout.

Created by Eren Demir.