Skip to main content

Earn a network boundary with evidence

What This Concept Is​

Extraction changes a local call into a protocol with independent failure and deployment behavior. Logical modularity is a prerequisite for evaluating this move, not proof that distribution is worthwhile. A boundary should earn its operational cost against an explicit quality scenario.

Why It Matters Here​

Semester 06 established that retries can duplicate effects and acknowledgments can be uncertain. Semester 07 applies those facts to architecture choice. A clean import graph is compatible with a fragile service that loses requests, shares mutable storage and cannot be rolled back independently.

Concrete Example​

Take a billing quotation capability with a public request/response contract. First implement it in-process. Then place the same behavior behind a local network endpoint. Inject a timeout before handling and a lost response after handling. For a mutating operation add a stable request identity and duplicate-effect protection; a pure quote may be safely recomputable but still needs explicit freshness and version semantics.

Compare result correctness, observed latency, changed files, deployment steps, logs needed to diagnose a failure and recovery work. Keep the same input trace and error cases. A faster warm run does not justify the extraction if it fails the required consistency or recovery scenario.

Common Confusion / Misconception​

A mocked network call does not demonstrate a network failure boundary. A subprocess that never sends requests over a socket does not exercise transport framing or timeout handling. Counting services or lines of code is not a substitute for measuring the quality goal. Avoid inventing target numbers after seeing results.

How To Use It​

Complete the original Distribution-Tax Spike and Reverse the Extraction labs. Freeze the scenario and baseline, run an actual local client/server, preserve traces for timeout/retry/recovery and retain a behavior test shared by both implementations. If the service does not earn the cost, merge its deployment back while retaining the module API. Document one condition that would justify trying extraction again.

Check Yourself​

Which failure can occur after the server changes state but before the client knows? Which coupling survives a clean import graph? What evidence would justify keeping a logical boundary but removing the network hop?

Mini Drill or Application​

Change one requirement, such as independent deployment or stale-read tolerance. Reassess your decision using the saved trace and cost ledger. State which new experiment is needed rather than guessing. Record who owns each deployment, schema and recovery action.

Read This Only If Stuck​

Fundamentals of Software Architecture — distributed styles and their tradeoffs. Revisit the Semester 06 outbox and replica-session exercises for uncertain outcomes and visibility. Those models explain mechanisms; this lab still requires a real local network experiment.