System.Xml.XmlElement
Listen and watch now on YouTube , Apple , and Spotify .
立即在 YouTube、Apple 和 Spotify 上收听和观看。
See the episode transcript at the top of this page, and timestamps for the episode at the bottom.
请参阅本页顶部的剧集记录,以及底部的剧集时间戳。
• turbopuffer – vector and full-text search built on object storage: fast, 10x cheaper, and extremely scalable.
•turbopuffer – 基于对象存储构建的矢量和全文搜索:速度快、成本低 10 倍,并且具有极高的可扩展性。
Under the hood, the team are rewriting the tpuf storage engine.
在幕后,该团队正在重写 tpuf 存储引擎。
Follow along until it hits production at turbopuffer.com/v3
请继续关注,直到它投入生产:turbopuffer.com/v3
• Get a free introduction to property-based testing : through a live, online webinar hosted by Hillel Wayne (a recent podcast guest !), author of Logic for Programmers and Developer Educator at Antithesis.
• 获得基于属性的测试的免费介绍:通过由 Hillel Wayne(最近的播客嘉宾!)主持的实时在线网络研讨会,他是《程序员逻辑》一书的作者和 Antithesis 的开发人员教育者。
What if you only needed a single test to harden your system?
如果您只需要一次测试来强化系统怎么办?
RSVP here .
请在此回复。
• Entire – Git hosting, rebuilt for the agentic era.
• 整体——Git 托管,为代理时代而重建。
Entire hosts your code in-region, and is up to 89x faster than any other competitor.
Entire 在区域内托管您的代码,速度比任何其他竞争对手快 89 倍。
Mirror from GitHub with a single click – I’ve already done so.
只需单击一下即可从 GitHub 进行镜像 - 我已经这样做了。
Sam Newman wrote one of the most-read books about microservices (“ Building Microservices ”), but he calls them an architecture of “last resort.”
Sam Newman 写了一本关于微服务的阅读量最大的书(《构建微服务》),但他称它们为“最后手段”的架构。
In this episode of the Pragmatic Engineer podcast, Sam explains his thinking on this, and he’s certainly well placed to do so; he was in the room when the term “microservices” was coined.
在务实工程师播客的这一集中,Sam 解释了他对此的想法,他当然有能力这样做;当“微服务”一词被创造出来时,他就在房间里。
We discuss what teams get wrong when adopting microservices, why independent deployment matters, and how microservices can help teams work more autonomously.
我们讨论团队在采用微服务时会犯哪些错误,为什么独立部署很重要,以及微服务如何帮助团队更加自主地工作。
We also peek into his new book, ‘ Building Resilient Distributed Systems ’, and Sam explains his three rules for distributed systems, why observability is essential, and also why it’s vital to take business context into account when deciding whether to fail open or fail closed on errors.
我们还浏览了他的新书《构建弹性分布式系统》,Sam 解释了他的分布式系统的三个规则,为什么可观察性至关重要,以及为什么在决定是否因错误而失败打开或失败关闭时考虑业务上下文至关重要。
We also explore how AI is changing software development, from specs versus code as a source of truth to cognitive debt and cognitive surrender.
我们还探讨了人工智能如何改变软件开发,从作为事实来源的规范与代码,到认知债务和认知放弃。
Sam shares how modular architecture can help teams experiment with AI while maintaining understanding of the systems being built.
Sam 分享了模块化架构如何帮助团队试验人工智能,同时保持对正在构建的系统的理解。
1.
1.
In the room when “microservices” was coined.
在“微服务”被创造出来的房间里。
In the early years of the 2010s, James Lewis – Sam’s colleague at Thoughtworks – kept running into companies building service-oriented architectures where each service could be replaced quickly.
在 2010 年代初期,Sam 在 Thoughtworks 的同事 James Lewis 不断遇到构建面向服务的架构的公司,其中每个服务都可以快速替换。
At an architecture symposium in the Lake District, England, James pitched a name for this trend: “micro apps,” and in a room of about 10 people (including Sam), someone else suggested “microservices.” Lewis and Martin Fowler then wrote the first article on the topic in March 2014, ‘ Microservices: a definition of this new architectural term ’, and Sam published the book Building Microservices the following year.
在英国湖区的一次建筑研讨会上,James 为这一趋势起了一个名字:“微应用”,在一个大约 10 人(包括 Sam)的房间里,其他人提出了“微服务”的建议。 Lewis 和 Martin Fowler 随后于 2014 年 3 月撰写了有关该主题的第一篇文章“微服务:这个新架构术语的定义”,Sam 于次年出版了《构建微服务》一书。
2.
2.
Sam spent 18 months teaching Googlers how to write good automated tests.
Sam 花了 18 个月的时间教 Google 员工如何编写良好的自动化测试。
In 2007, Sam was embedded at Yahoo and Google as a ThoughtWorks consultant, alongside people from Pivotal Labs.
2007 年,Sam 与 Pivotal Labs 的人员一起作为 ThoughtWorks 顾问加入雅虎和谷歌。
Their job was to teach engineers how to write automated tests, and code that’s testable.
他们的工作是教工程师如何编写自动化测试和可测试的代码。
He recalls that some Google devs did not believe it was possible to write automated functional tests for websites, until Sam and his colleagues showed them how Selenium works!
他回忆说,一些 Google 开发人员不相信可以为网站编写自动化功能测试,直到 Sam 和他的同事向他们展示 Selenium 的工作原理!
3.
3.
Sam spent 10+ years at a large company, three years at startups, and has been independent for more than a decade.
Sam 在一家大公司工作了 10 多年,在初创公司工作了三年,并且已经独立十多年了。
After 13 years at Thoughtworks, he quit to avoid becoming “institutionalized.” He recalls thinking he could hang around at Thoughtworks and grow bitter.
在 Thoughtworks 工作了 13 年后,他辞职了,以避免被“机构化”。他回忆说,他原本以为自己可以在 Thoughtworks 闲逛,但结果却变得痛苦起来。
“So I’ll just go now.” He then worked at three different startups before going independent, which he’s now done for 15 years.
“那我现在就走了。”随后,他在 3 家不同的初创公司工作过,之后开始独立,现在已经工作了 15 年。
The biggest challenge of being your own boss?
自己当老板最大的挑战是什么?
He says: “The problem of working for yourself is that the boss is frequently an a*****e.
他说:“为自己工作的问题在于,老板常常是个坏人。
So, current Sam frequently is cursing past Sam for the commitments he made!”
所以,现在的山姆经常咒骂过去的山姆所做的承诺!”
4.
4.
So, what’s a “microservice?” Sam gives two definitions: a clear one, and a softer one:
那么,什么是“微服务”? Sam 给出了两种定义:一种是明确的,另一种是较温和的:
Independently deployable service.
可独立部署的服务。
The “clear” definition: as long as, upon a change to a system, it can be independently deployed – without any other services needing to be deployed –, you can call it a microservice.
“明确”的定义是:只要系统发生变化,可以独立部署,不需要部署任何其他服务,就可以称之为微服务。
Clear boundaries around the business domain.
业务领域的边界清晰。
The “softer” definition: services split by business function (not by technical layer) can also be called microservices.
“更软”的定义:按业务功能(而不是按技术层)划分的服务也可以称为微服务。
5.
5.
Three rules of distributed systems: Sam sometimes struggled to recall the eight fallacies of distributed computing , and so he boiled them down to the three that cause the most problems:
分布式系统的三个规则:Sam 有时很难回忆起分布式计算的八个谬误,因此他将它们归结为导致最多问题的三个:
1.
1.
Information takes time to travel.
信息的传播需要时间。
You cannot send information instantaneously from point A to point B.
您无法立即从 A 点向 B 点发送信息。
This is basically the “speed of light” constraint.
这基本上是“光速”约束。
2.
2.
Sometimes, the thing you want to talk to isn’t there.
有时候,你想交谈的对象并不存在。
That is, resources can and do go offline.
也就是说,资源可以而且确实会离线。
3.
3.
Resources are not infinite; you will eventually run out of things like CPU, memory, storage, and networking bandwidth.
资源不是无限的;你最终会耗尽 CPU、内存、存储和网络带宽等资源。
In Sam’s experience, most distributed systems outages are caused by #3; resource pools running out.
根据 Sam 的经验,大多数分布式系统中断都是由#3 引起的;资源池即将耗尽。
6.
6.
Dealing with idempotency: keys or fingerprints?
处理幂等性:密钥还是指纹?
Idempotency is performing the same operation multiple times and it having the same effect as if done once only.
幂等性是多次执行相同的操作,并且其效果与仅执行一次相同。
For example, if you repeatedly hit the “down” button for an elevator, nothing more happens than what happened upon that first press: multiple button smashes don’t bring more elevators your way.
例如,如果您反复按下电梯的“向下”按钮,则不会发生比第一次按下时发生的情况更多的事情:多次按下按钮不会为您带来更多电梯。
Payments are a classic example where idempotency is needed: when you retry or refresh a payments page, you should not be charged twice.
付款是需要幂等性的典型示例:当您重试或刷新付款页面时,不应向您收取两次费用。
Idempotency keys : a client sends a unique identifier (usually a UUID) that is the idempotency key.
幂等性密钥:客户端发送一个唯一标识符(通常是 UUID),即幂等性密钥。
The server makes sure operations with the same idempotency key are executed only once.
服务器确保具有相同幂等性密钥的操作仅执行一次。
It’s clean to build but hard to retrofit, which involves changing both the client and server.
它构建起来很干净,但很难改造,这涉及到更改客户端和服务器。
Fingerprints: the client sends nothing, but the server creates a “fingerprint” of the request by hashing relevant fields.
指纹:客户端不发送任何内容,但服务器通过散列相关字段来创建请求的“指纹”。
It’s easy to retrofit later (only need to change the server), however, legitimate requests can be rejected as duplicates, and duplicate requests could still happen.
后期改造很容易(只需要更改服务器),但是,合法请求可能会因为重复而被拒绝,并且重复请求仍然可能发生。
Sam describes a Danish payment system he worked on that rejected purchases of the same value within a 5-minute period while it did the fingerprinting.
Sam 描述了他所开发的丹麦支付系统,该系统在进行指纹识别时会在 5 分钟内拒绝购买相同价值的商品。
7.
7.
Four concepts of resiliency: Sam frequently references the four outcomes for military systems, explained by David Woods :
弹性的四个概念:萨姆经常提到军事系统的四个结果,大卫·伍兹解释说:
Robustness : systems continue to function as intended, for example, when Kubernetes replaces a failing pod.
鲁棒性:系统继续按预期运行,例如,当 Kubernetes 替换出现故障的 Pod 时。
A downside of robustness is that it can add complexity, and more complex systems have more ways to fail.
鲁棒性的一个缺点是它会增加复杂性,而更复杂的系统有更多的失败方式。
Extensibility : dealing with surprises and being able to stretch the system’s support to deal with new needs
可扩展性:应对意外情况并能够扩展系统的支持来应对新的需求
Adaptability : the system changing to support new functions.
适应性:系统不断变化以支持新功能。
Resilient systems are adapted, even between incidents.
即使在不同事件之间,弹性系统也会进行调整。
8.
8.
What if code is a side effect of collaboration?
如果代码是协作的副作用怎么办?
When Sam was at Thoughtworks, some clients refused to do pair programming as a practice because they could only see one developer typing and the other doing nothing, which is a waste.
当 Sam 在 Thoughtworks 时,一些客户拒绝将结对编程作为一种实践,因为他们只能看到一个开发人员打字,而另一个开发人员什么都不做,这是一种浪费。
Martin Fowler’s dictum that “programming is not typing” helped Sam to explain to clients that typing out code is an output, but not an outcome.
Martin Fowler 的格言“编程不是打字”帮助 Sam 向客户解释说,敲出代码是一种输出,而不是结果。
Sam conceives programming as building a system collectively, and code is one of the mechanisms delivering the system.
Sam 将编程视为集体构建系统,而代码是交付系统的机制之一。
Now that with LLMs we no longer spend most time typing out code, we’ll discover the next bottleneck in creating good software.
现在,有了法学硕士,我们不再花大部分时间敲代码,我们将发现创建优秀软件的下一个瓶颈。
Could it be delayed feedback cycles?
会不会是反馈周期延迟了?
9.
9.
Hedging the vendor options is sensible when integrating AI into systems.
将人工智能集成到系统中时,对冲供应商的选择是明智的。
It’s hard to tell which AI companies have long-term, sustainable business models and which don’t, so it’s the responsible thing when designing systems to hedge the providers.
很难判断哪些人工智能公司拥有长期、可持续的商业模式,哪些没有,因此在设计对冲提供商的系统时,这是负责任的事情。
Aim to be multi-vendor, multi-model in your choices, so you can easily change the vendor or model layer.
您的选择目标是多供应商、多型号,这样您就可以轻松更改供应商或型号层。
Also, consider if you can swap out LLM-powered functionality for deterministic code that runs faster and cheaper.
另外,请考虑是否可以将 LLM 支持的功能替换为运行速度更快、成本更低的确定性代码。
10.
10.
We must resist “cognitive surrender” to AI.
我们必须抵制对人工智能的“认知投降”。
Sam believes that more AI usage is leading to less critical thinking – or could we be using it wrong?
Sam 认为,更多的人工智能使用会导致批判性思维的减少——或者我们可能用错了它?
He says: “The original pitch of AI was it was going to free us from drudgery.
他说:“人工智能最初的定位是它将把我们从苦差事中解放出来。
We’d have less toil, and we can focus more on critical thinking and smarts.
我们的辛苦工作就会减少,我们可以更加专注于批判性思维和智慧。
However, much of our current use of AI is not freeing us up from critical thinking!
然而,我们目前对人工智能的大部分使用并没有让我们摆脱批判性思维!
It’s causing more context switching and leaving less time for thinking.
它导致更多的上下文切换,并留下更少的思考时间。
People are working longer hours; we’ve got studies that show this.
人们的工作时间越来越长;我们的研究表明了这一点。
But [longer hours and more context switching] is not necessarily AI’s fault.
但[更长的工作时间和更多的上下文切换]不一定是人工智能的错。
It’s just how we’re using it.”
这就是我们使用它的方式。”
Putting in the effort often leads to better results.
付出努力往往会带来更好的结果。
For example, when writing Building Resilient Distributed Systems, Sam used NotebookLM for research, but he manually clicked through each link it surfaced, and checked whether it was information he wanted to reference.
例如,在撰写“构建弹性分布式系统”时,Sam 使用 NotebookLM 进行研究,但他手动单击出现的每个链接,并检查这是否是他想要引用的信息。
11.
11.
Starting with modules encourages better software architecture.
从模块开始可以鼓励更好的软件架构。
Also: production is truth.
还有:生产就是真理。
I asked Sam for advice on what to do to get better at designing systems:
我向 Sam 询问如何才能更好地设计系统:
Start by thinking carefully about module boundaries and the connections between them
首先仔细考虑模块边界以及它们之间的连接
When you use AI, allow it to roam freely, but only inside the module structure that you have designed!
当你使用AI时,让它自由漫游,但只能在你设计的模块结构内!
12.
12.
Much of the tech world might still be naive about what an LLM is.
科技界的大部分人可能对法学硕士是什么还很天真。
As Sam said:
正如萨姆所说:
“I think the tech world in general is quite naive about AI and fundamentally misunderstands what an LLM is.
“我认为科技界总体上对人工智能相当天真,并且从根本上误解了法学硕士是什么。
For example: why did the LLM delete my database?
例如:为什么法学硕士删除了我的数据库?
Well, because it has no concept of causality.
嗯,因为它没有因果关系的概念。
They have no concept that if I do A, B happens.
他们不知道如果我做了 A,B 就会发生。
LLMs are not world models.
法学硕士不是世界典范。
World models have been around for a long time.
世界模型已经存在很长时间了。
They predate LLMs.
他们早于法学硕士。
So if you had the appropriate model and the appropriate inputs, world models could at least get to the point of ‘if I do X, then Y happens and I’ve been told not to do Y.’
因此,如果你有适当的模型和适当的输入,世界模型至少可以达到“如果我做 X,那么 Y 就会发生,并且我被告知不要做 Y”的程度。
I think we expect LLMs to do more than they actually can do, because they seem so smart.
我认为我们期望法学硕士能做的比他们实际能做的更多,因为他们看起来很聪明。
This leads us to overestimate their capabilities a bit too much.
这导致我们过高估计了他们的能力。
But the nature of LLMs is why all the guardrails around LLMs are really not going to be the right long-term solution.”
但法学硕士的本质就是为什么围绕法学硕士的所有护栏实际上并不是正确的长期解决方案。”
Sam’s comments feel very timely, given Opus 5.5 just formatted the hard drive of a dev who ran the model with the —dangerously-skip-permissions tag, and was surprised to see all of his data gone.
Sam 的评论感觉非常及时,因为 Opus 5.5 刚刚格式化了一位使用“危险跳过权限”标签运行该模型的开发人员的硬盘,并且惊讶地发现他的所有数据都消失了。
Finally, recommended reading to get better at software architecture.
最后,推荐阅读以更好地了解软件架构。
Sam’s recommendations:
萨姆的建议:
On the criteria to be used in decomposing systems into modules : a paper by David Parnas from the 1970s original papers from the early 1970s, such as
关于将系统分解为模块的标准:David Parnas 的一篇论文,来自 20 世纪 70 年代初的原始论文,例如
An architecturally-evident coding style: making your design visible : a paper by George Fairbanks, published in 2010.
架构上明显的编码风格:让你的设计可见:乔治·费尔班克斯 (George Fairbanks) 于 2010 年发表的论文。
It’s an approach that allows the code to hint at the system’s architecture
这是一种允许代码暗示系统架构的方法
Uptime Labs : incident response training, backed by science.
Uptime Labs:以科学为后盾的事件响应培训。
In the episode, Sam said this about them:
在这一集中,萨姆这样评价他们:
“I’d like to give a shout out to Uptime Labs who are based here partly here in London.
“我想向 Uptime Labs 表示敬意,他们的总部部分位于伦敦。
They do excellent instant training that you can do online in a web browser.
他们提供出色的即时培训,您可以在网络浏览器中在线进行。
It’s fantastic.
太棒了。
They are really great.”
他们真的很棒。”
• TDD, AI agents and coding with Kent Beck: https://newsletter.pragmaticengineer.com/p/tdd-ai-agents-and-coding-with-kent
• TDD、AI 代理和 Kent Beck 编码:https://newsletter.pragmaticengineer.com/p/tdd-ai-agents-and-coding-with-kent
• How Kent Beck shapes the software engineering industry: https://newsletter.pragmaticengineer.com/p/how-kent-beck-shapes-the-software
• Kent Beck 如何塑造软件工程行业:https://newsletter.pragmaticengineer.com/p/how-kent-beck-shapes-the-software
• Growing Object-Oriented Software Guided by Tests: https://growing-object-oriented-software.com/
• 以测试为指导不断发展面向对象的软件:https://grinding-object-orient-software.com/
• How AI will change software engineering – with Martin Fowler: https://newsletter.pragmaticengineer.com/p/martin-fowler
• 人工智能将如何改变软件工程——与 Martin Fowler 合作:https://newsletter.pragmaticengineer.com/p/martin-fowler
• James Lewis on LinkedIn: https://www.linkedin.com/in/james-lewis-microservices
• James Lewis 在 LinkedIn 上:https://www.linkedin.com/in/james-lewis-microservices
• Building Microservices: Designing Fine-Grained Systems: https://www.amazon.com/dp/1492034029
• 构建微服务:设计细粒度系统:https://www.amazon.com/dp/1492034029
• Scaling Uber with Thuan Pham (Uber’s first CTO): https://newsletter.pragmaticengineer.com/p/scaling-uber-with-thuan-pham-ubers
• 与 Thuan Pham(Uber 首位首席技术官)一起扩展 Uber:https://newsletter.pragmaticengineer.com/p/scaling-uber-with-thuan-pham-ubers
• Stop being skeptical about AI for development with Charity Majors: https://newsletter.pragmaticengineer.com/p/stop-being-skeptical-about-ai-for
• 不要再对慈善专业的人工智能发展持怀疑态度:https://newsletter.pragmaticengineer.com/p/stop-being-skeptical-about-ai-for
• Understanding Spec-Driven-Development: Kiro, spec-kit, and Tessl: https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html
• 了解规范驱动开发:Kiro、spec-kit 和 Tessl:https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html
• Beyond Vibe Coding with Addy Osmani: https://newsletter.pragmaticengineer.com/p/beyond-vibe-coding-with-addy-osmani
• 与 Addy Osmani 一起进行超越 Vibe 编码:https://newsletter.pragmaticengineer.com/p/beyond-vibe-coding-with-addy-osmani
• Building Resilient Distributed Systems: https://samnewman.io/books/building-resilient-distributed-systems
• 构建弹性分布式系统:https://samnewman.io/books/building-resilient-distributed-systems
• How Generative and Agentic AI Shift Concern from Technical Debt to Cognitive Debt: https://margaretstorey.com/blog/2026/02/09/cognitive-debt
• 生成式和代理式人工智能如何将关注点从技术债务转移到认知债务:https://margaretstorey.com/blog/2026/02/09/cognitive-debt
• Fundamentals of Software Architecture: A Modern Engineering Approach: https://www.amazon.com/dp/1098175514
• 软件架构基础知识:现代工程方法:https://www.amazon.com/dp/1098175514
• Balancing Coupling in Software Design: Universal Design Principles for Architecting Modular Software Systems: https://www.amazon.com/Balancing-Coupling-Software-Design-Addison-wesley/dp/0137353480
• 软件设计中的平衡耦合:构建模块化软件系统的通用设计原则:https://www.amazon.com/Balancing-Coupling-Software-Design-Addison-wesley/dp/0137353480
• Learning Domain-Driven Design: Aligning Software Architecture and Business Strategy: https://www.amazon.com/Learning-Domain-Driven-Design-Vlad-Khononov-ebook/dp/B09J2CMJZY
• 学习领域驱动设计:协调软件架构和业务战略:https://www.amazon.com/Learning-Domain-Driven-Design-Vlad-Khononov-ebook/dp/B09J2CMJZY
• Software Fundamentals: Collected Papers by David L.
• 软件基础知识:David L. 的论文集
Parnas: https://www.abebooks.com/9780201703696/Software-Fundamentals-Collected-Papers-David-0201703696/plp
帕纳斯:https://www.abebooks.com/9780201703696/Software-Fundamentals-Collected-Papers-David-0201703696/plp