系统与基础设施brandur.org编辑精选
PostgreSQL 如何实现原子性事务
How Postgres Makes Transactions Atomic
2017 — 2019,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇文章深入讲解 PostgreSQL 如何实现事务原子性,涉及事务 ID、提交日志、MVCC 和堆元组可见性等内部机制。作者通过阅读大量 PostgreSQL 源码,用清晰的解释和图示拆解了这个通常被视为“黑盒”的数据库核心行为。
为什么经久不衰:它把数据库最核心也最抽象的事务原子性讲得清楚且有源码依据,配图精良,多年后仍是理解 PostgreSQL MVCC 的经典入门材料。
HN 评论精选
作者分享写作动机,并称赞 PostgreSQL 源码质量和可读性。
作者本人:写这篇文章是一次很棒的学习经历。Postgres 一直是终极黑盒,做了很多神奇的事,但我通常不知道它怎么做到的。为了完成文章我读了很多 Postgres 代码,很高兴地说,尽管作者众多,代码质量非常高。命名大多自解释,还有很棒的注释带你理解高层设计。
brandur查看英文原文
Author here with just a quick note that writing this was a pretty great learning experience. Postgres has always been the ultimate black box — it does some amazing things, but I generally have no idea how. I read a lot of Postgres code to get this finished, and I'm happy to say that for a codebase with so many authors, the quality of Postgres' is very high. Like any complex program it can be a little hard to trace through, but most of the naming is pretty self-explanatory, and it comes with some really amazing comments that walk you through the high-level design. I'd definitely recommend taking a look if anyone is curious.
补充说明文中精美图表由 Monodraw 绘制。
从之前的讨论中我发现,作者是用 Monodraw 制作那些图表的。我很期待去试试。
teej查看英文原文
From the previous discussion, I discovered that the author used Monodraw to create the diagrams. I'm excited to check it out - https://monodraw.helftone.com/
初学者感谢文章并好奇文中函数名是否经过改写。
作为软件工程领域的新手,我非常感谢写这类文章的人。它帮我探索模式和优秀的工程实践。顺便问一下,函数真的叫那些名字,还是作者为了清晰改过名?
aneutron查看英文原文
As a beginner in the software engineering realm, I cannot thank people who give these kind of write-ups enough. It helps me explore patterns and beautiful pieces of engineering. On a side note I wonder if the functions are really named like that or did the author rename some for clarity?
强调标题中的“How”很重要,并再次肯定文章质量。
请提交者或版主把标题里的“How”加回去。这通常是自动处理的,但有时会出错,这里尤其明显。另外,这篇文章对 PostgreSQL MVCC 本质的讲解依然和以前一样精彩。
rosser查看英文原文
Submitter, or a moderator, please edit the title to re-add the word "How". That's done automatically, but sometimes it's wrong. It's especially so here. Also, this remains as fantastic an article on PostgreSQL's MVCC nature as it was previously: https://news.ycombinator.com/item?id=15027870
历次讨论
同类还值得读
TTY 揭秘(2008)
The TTY demystified (2008)
经典文章深入剖析了 Unix/Linux 中 TTY 子系统的工作原理,包括线路规程、终端驱动、信号与控制字符等机制。
系统与基础设施上首页 11 次 · 2009–2025linusakesson.net编辑精选为什么 GNU grep 这么快
Why GNU grep is Fast
FreeBSD 邮件列表上一篇广为流传的帖子,解释 GNU grep 为什么快:核心在于 Boyer-Moore 字符串搜索算法配合精心优化的内部循环和 I/O,让程序在搜索时“…
系统与基础设施上首页 9 次 · 2010–2022lists.freebsd.orgXplain:为普通人讲解 X11
Xplain – Explaining X11 for the rest of us
《Xplain》是作者(HN 用户 Jasper_)写的一系列 X11 长文,用他在浏览器中重建的 X11 绘图模型做交互演示,讲解 X11 的绘图模型与窗口系统设计。
系统与基础设施上首页 6 次 · 2013–2020magcius.github.io编辑精选旋风教程:为 Linux 创建极小 ELF 可执行文件(1999)
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (1999)
breadbox 写于 1999 年的经典教程,主题是如何为 Linux 手工构造并裁剪出体积极小的 ELF 可执行文件。
系统与基础设施上首页 6 次 · 2007–2025muppetlabs.comPostgreSQL 内部原理
The internals of PostgreSQL
《The Internals of PostgreSQL》是一本免费在线书籍,系统讲解 PostgreSQL 的内部实现,包括查询处理、并发控制、WAL、缓冲区管理等核心机制。
系统与基础设施上首页 5 次 · 2017–2025interdb.jp编辑精选