The Pragmatic Engineer — selected conversations
Building resilient systems with Sam Newman
Twenty-five curated conversations on agent workflows, software factories, software correctness, developer platforms, engineering leadership, resilient systems, and software quality
A manually reviewed selection of Pragmatic Engineer conversations with Katelyn Lesse, Harjot Gill, Satya Nadella, Sean Allen, Will Larson, Uday Kiran Medisetty, Sam Newman, Maggie Appleton, Matt Pocock, Tibo Sottiaux, Martin Fowler, Dex Horthy, Boris Cherny, Mario Zechner and Armin Ronacher, Laura Tacho, Hillel Wayne, Mitchell Hashimoto, Kent Beck, Peter Steinberger, Grady Booch, Steve Yegge, DHH, Dax Raad, Charity Majors, and Addy Osmani. Topics include software factories and risk-based review, software correctness and fault-injection test workloads, engineering management and careers, developer platforms, resilient distributed systems, design prototyping, reusable skills, agent workflows, context and harness design, TDD and verification, architecture, measurement, accountability, and open-source governance. Practitioner observations, product-team and vendor claims, and forecasts are not controlled findings.
In this collection Browse 25 summaries 7 of 25
Sam Newman, author of Building Microservices and the new Building Resilient Distributed Systems, discusses microservices, distributed-systems failures, and resilience engineering. Newman, a former ThoughtWorks consultant who now works independently, also covers how coding agents change where engineers need to spend attention: specifications, verification, module boundaries, and the risks of relying on model vendors.
Based on the video's English auto-generated captions, not an independent review of the audio. Newman's accounts of other companies, such as Chainguard, Monzo, and Square, are his descriptions and are not verified here. His statements about LLM capabilities and AI-industry economics are opinions; he identifies the source of the economic figures only as "the economists."
Key points
-
Programming is a shared theory, not typing. Newman cites Peter Naur's description of a program as a theory held in the minds of the people who build it; the code is a side effect of that collaboration. Speeding up coding exposes constraints elsewhere, and he argues that coding itself often was not the bottleneck; how it was done, such as delayed feedback cycles, was. He recalls Martin Fowler's remark that "programming is not typing" from earlier arguments about pair programming. 16:35–20:06(opens in a new tab)
-
Microservices are an architecture of last resort. Newman's definition rests on two opinions: each service must be independently deployable, which matters most, and service boundaries should usually follow the business domain. He calls microservices a last resort because they push teams toward aggressively distributing state. The strongest reason to adopt them is wanting teams that can act independently; the architecture is one means to that organizational autonomy, not a source of benefits by itself. 26:32–28:24(opens in a new tab), 30:03–31:35(opens in a new tab)
-
Decide where the system's source of truth lives. Citing an article on Martin Fowler's website about spec-driven development, Newman describes a spectrum: some teams use a specification to generate code and then discard it, some keep the spec updated as features change, and some no longer look at the code. He thinks more questions need answers before a spec can be the source of truth, and says production is always the real truth. 35:18–38:21(opens in a new tab) Working at the spec level requires engineers to make tacit knowledge explicit. He also warns that individuals working with assistants in separate directions break down the team's shared mental model of the program; collaborative work on specs could rebuild it. 38:21–40:24(opens in a new tab)
-
Not reading code requires other evidence that the system works. Newman reports that Chainguard stopped human code review to spend more time on design and document-level thinking, and he accepts that trade when teams think critically about how the system should behave and change. Skipping code review without that work, he says, invites the consequences. Speakers at an O'Reilly event he ran agreed that spec-driven development only works if you can define what good looks like; one small team feeds its OpenTelemetry data back to its agent. He argues that acceptance criteria need to cover more than narrow functional requirements. 40:24–43:14(opens in a new tab)
-
Three rules explain most distributed-systems problems. Information takes time to travel; sometimes the thing you want to talk to is not there; and resource pools are not infinite. Newman's examples of unavailable components include a storage array partly on fire and rabbits chewing through a network cable. He says most outages come down to a saturated resource, often worsened by retry storms and connection starvation, and suggests starting from these rules before studying consensus protocols or CAP. 52:46–56:39(opens in a new tab)
-
Build observability in from the start. A single program gives useful signals such as CPU use, debuggers, and thread dumps. A distributed system needs extra work to produce and correlate equivalent signals, and that work is much easier at the start than as a retrofit. Without a service's normal latency distribution, a client cannot choose a sensible timeout. 56:39–59:18(opens in a new tab) Traces stitch spans (individual activities) across machines into one view of a request. Service level indicators (SLIs) classify each event as good or bad, and their aggregate shows whether the team meets its service level objective (SLO), a commitment such as a latency target. 1:00:10–1:02:55(opens in a new tab)
-
Decide how resilient each system needs to be. Resilience is a matter of degree, so teams need a target, as security needs a threat model. Newman describes Monzo's stand-in bank: a stripped-down rewrite with no shared code, on a different cloud provider, run constantly at about a tenth of the main platform's cloud cost. That fits Monzo but is not where most teams should start. 1:01:55–1:04:45(opens in a new tab) He assumes companies such as Zoom chose not to go multi-region after weighing the cost, which he considers acceptable when the decision matches what users expect. Delivering only what the service level agreement (SLA) requires rarely keeps customers happy. 1:06:35–1:08:17(opens in a new tab)
-
Prefer idempotency keys; use fingerprints to retrofit. An idempotent operation has the same effect however often it is applied, like pressing a lift button twice. When a payment request gets no response, the client cannot tell whether it ran, so retrying is safe only if the operation is idempotent. 1:07:28–1:10:53(opens in a new tab) With an idempotency key, the client sends a unique ID, usually a UUID, and the server recognizes retries. Both sides must support the key, so it is best added from the start. A server-side fingerprint, a hash of the request fields, can be retrofitted but rejects legitimate identical requests, such as provisioning 20 identical EC2 instances in a loop. Keeping fingerprints only for a time window reduces this. Combining both lets a server reject a retry that reuses a key with changed parameters. 1:10:53–1:16:18(opens in a new tab)
-
Thundering herds share a cause but need different mitigations. Each is too many requests for too few resources. Newman's examples include denial-of-service attacks, a cache restart that sends all traffic to the origin, Square's 2017 outage where clients retried Redis up to 500 times without delay, and legitimate demand such as healthcare.gov launching in 36 states at once. Autoscaling can absorb a startup's spike of success, but against a denial-of-service attack it mostly converts lost service into lost money. 1:16:18–1:21:53(opens in a new tab)
-
Failure behavior is a business decision. If an online shop cannot confirm stock, it usually sells anyway because it can back-order or refund. A concert-ticket seller should refuse, because a ticket that turns out not to exist does much more harm. The choice is made feature by feature, not once for the whole system. Newman treats CAP and PACELC as later reading: when one part of the system cannot reach another, start by asking a product owner what should happen. 1:20:50–1:26:26(opens in a new tab)
-
Resilience has four dimensions, and two depend on people. Drawing on David Woods, Newman lists robustness (absorbing known disturbances, such as Kubernetes replacing a failed pod), rebound (recovering after failure), graceful extensibility (handling surprises), and sustained adaptability (continually learning and changing the system). Many engineers focus only on robustness, and robustness mechanisms add complexity and new failure modes. Rigid, hierarchical organizations handle surprise badly; drills help, and reading other companies' incident reports supports learning. He argues that the last two dimensions require psychological safety. 1:25:30–1:32:41(opens in a new tab)
-
Hedge against AI vendor risk. Newman doubts the economics of model providers. He cites a conservative analysis "by the economists" (the captions do not identify the source further) saying OpenAI, Anthropic, and the hyperscalers need $2.6 trillion in annual revenue by 2030 to justify their spending, against a software market of $1.4 trillion. His practical response is to use several vendors and models, including open-weight models. He also suggests replacing a single agent with workflows, so individual steps can later be swapped for deterministic code. He says OpenAI's and Anthropic's model availability is poor, so people he knows use Google, Amazon, or Microsoft as their primary source or fallback. He accepts Charity Majors's point that distributed systems were never deterministic; LLMs add more nondeterminism. 1:33:29–1:37:11(opens in a new tab)
-
Opinion: have agents call tested scripts. Newman argues that LLMs have no concept of causality, so they cannot anticipate consequences such as deleting a database, and guardrails are not a long-term fix. People overestimate them because they seem smart. Where possible, an agent should call a script known to work rather than reproduce its logic. Code generation works comparatively well because its output can be executed and checked. For his book's research he used NotebookLM and opened every link it cited. 1:36:17–1:39:55(opens in a new tab)
-
Cognitive debt and cognitive surrender are different risks. Newman describes cognitive debt as the erosion of critical thinking and of a team's shared mental model, citing Margaret-Anne Storey's article and research he does not detail. Cognitive surrender is accepting whatever the AI says, like approving a pull request with "LGTM" without reading it. His oncology example contrasts an AI that flags a spot the specialist may have missed, which helps, with one that hands the specialist scans to sign off, which turns the expert into an approver. Citing studies he does not name, he argues that current AI use often brings more context switching and longer hours rather than less drudgery, and attributes that to how people use it. 1:39:55–1:43:23(opens in a new tab)
-
Use module boundaries to decide where agents work with less supervision. Newman worries that AI adds complexity on top of existing platform complexity instead of prompting simplification. 1:43:23–1:45:01(opens in a new tab) He proposes letting AI work freely inside modules whose internals are easy to change while humans design the modules and the connections between them. A low-risk module could become a "software factory" where nobody reads the code but its interface is specified and verified; critical areas stay collaborative. Good candidates have strong test coverage, are off latency-critical paths, have good observability and SLOs, and could be rewritten within weeks. Some companies already work this way; he says not everyone should, and treats it as one possible future. 1:45:01–1:50:13(opens in a new tab)
-
Start with specs and verification before trying a factory. Newman suggests learning spec-driven development tools such as Cucumber, Tessl, or Spec Kit, then deciding how to verify output against developer requirements (such as maintainability), operational requirements (such as latency and uptime), and business requirements (whether features work), a split he credits to Kevlin Henney. If a team cannot define good for those three, the factory approach is not for it, though specs still help. He warns that it could repeat the failure of model-driven development. 1:50:13–1:52:22(opens in a new tab) When the host suggests using agents to make existing code more modular, Newman adds that this needs a decent test suite first. He also wants the code itself to make the architecture visible, so the team's mental model does not live only in people's heads. 1:53:24–1:55:21(opens in a new tab)
Full video: https://www.youtube.com/watch?v=a0sZV0qIbI0(opens in a new tab)