Chapter 47
An Engineering System Design and Review Method
On this page
The difficult design decisions are at boundaries: outcome verification, state ownership, version transitions, and overload. Compare systems by those obligations before choosing their components.
Establish the same six facts for different applications¶
| Design fact | Retrieval service | Offline extraction | Code-change agent |
|---|---|---|---|
| Accepted outcome | Supported answer from eligible current evidence | Correct normalized record or explicit exception | Patch satisfies specified checks |
| Workload | Query/corpus/permission distributions | Document lengths, formats, nightly deadline | Repository sizes, tool latency, task horizon |
| Dominant state | Index generation, authority, request KV | Input revision, output lineage, batch cursor | Workspace, tool receipts, pending actions |
| Critical path | Retrieval, reranking, generation, verification | Decode and independent field validation | Sequential observations and test execution |
| Failure boundary | Stale or unauthorized evidence | Partial batch publication or silent wrong field | Ambiguous write or misleading tool result |
| Acceptance experiment | Paired queries plus revocation/migration tests | Held-out records plus restart/replay | Final repository state plus bounded budgets |
These facts determine the initial architecture and the smallest experiment that could reject it. The documentation case below assumes 200,000 chunks and a 60-query/s peak. Its 768-component FP32 vectors occupy 614.4 MB before index and metadata, so raw vector capacity alone does not justify sharding. Filtered search latency and update behavior may still do so.
For an extraction job of one million records in eight hours, required useful throughput is about 34.7 records/s. If the generator emits 50 records/s but only 60% survive independent verification, useful throughput is 30/s before retry costs: the deadline is infeasible. Reducing per-record latency is one option; improving accepted yield or changing capacity is another. The calculation identifies a constraint without prescribing retrieval, tools, or an agent.
The extraction service can checkpoint a batch cursor and publish an immutable result manifest. An interactive retrieval service needs request deadlines and current authorization. A code agent needs durable effect identity and reconciliation. Treating all three as the same prompt/response service loses the state that determines correctness.
Review migrations and overload, not only the steady state¶
An architecture review should specify the transition between versions. For the documentation assistant, define a routing manifest that binds the parser, chunker, query/document encoders, index generation, reranker, prompt, and verifier. Build a compatible candidate beside the current version, shadow a bounded sample, compare on the same corpus and authority snapshot, and switch the manifest atomically. Retain the previous compatible set for rollback. A rollback must still consult current permissions and deletion tombstones; it must not resurrect revoked documents.
Use Little's law on a stable operating interval as a first capacity check: average in-flight requests equal arrival rate times mean time in the system. At 60 requests per second and a two-second mean, expect about 120 requests in flight. If mean time rises to eight seconds while admissions stay at 60, the corresponding average is 480. This is not a p99 guarantee or a model for an indefinitely growing queue. Set bounded queues and admission limits before overload makes that growth self-reinforcing.
Give the request one end-to-end deadline. Each stage consumes the remaining budget; a retry does not reset the clock. Cancellation should stop avoidable downstream work, but cancellation of a waiting client cannot undo a remote write that already committed. Preserve that ambiguous outcome for reconciliation. Shadow experiments also consume capacity, so budget them separately and suppress external effects.
Review exercise: the new index improves recall but doubles reranker candidates. What must the review revisit? Candidate quality, reranker queueing, generation admission, end-to-end tails, and cost per verified answer. Approving the index from isolated recall alone misses the changed critical path.
Tradeoff matrix¶
| Decision | Option A | Option B | Flip condition |
|---|---|---|---|
| Sync vs async | Caller waits for completion | Caller receives an acceptance handle | Choose from completion latency and retry semantics; neither alone guarantees consistency |
| Push vs pull | Low update latency | Consumer-controlled load | Fanout or offline consumers dominate |
| Replicate vs shard | Availability, simple reads | Capacity, write scaling | One node or replica no longer fits |
| Exact vs approximate | Strong semantics | Lower cost or latency | Bounded error is product-acceptable |
| Shared vs isolated | High utilization | Failure and security isolation | Noisy neighbor or compliance risk dominates |
Communicating the design¶
Use the six design facts as the review outline and keep unresolved risks beside the affected component. Part VIII's Executive Technical Communication supplies the decision-record format and rules for recording dissent and revisiting a choice.
Design Exercises¶
- Run the method on a feature store or evaluation service.
- Which estimates change a vector database architecture?
- How do you represent failure domains clearly in an architecture diagram?
- What makes an approximation acceptable?
- Name a component you would defer in a new LLM platform and the trigger to add it.
Worked answer criteria¶
Use the six design facts to structure the answer. Quantify the estimate that changes placement, mark failure domains on the diagram, and give the error bound that permits an approximation. For a deferred component, name the workload or failure that would justify adding it.