按年被提到
20232023 · 16 次2026
开源书›系统与网络·No.90

Build Your Own Redis with C/C++

用 C/C++ 自己动手写 Redis
James Smith

从零用 C/C++ 实现一个简化版 Redis,边写边学网络与数据结构

免费阅读 ↗
被推荐 · 23 人首次 2023-01-29 · 最近 2025-05-21官方免费在线(版权保留,作者或出版社免费放出)
23不同的人
14活跃月份
2有推荐的月份
25讨论串

作者 James Smith 带读者用 C/C++ 从头实现一个简化的 Redis 服务器,网页版可免费在线读,没有开放许可,另有 epub、PDF 和纸质版。内容围绕 socket 网络编程、事件循环、协议解析和哈希表等数据结构展开,以可运行代码一步步推进。和讲原理的书不同,它要求读者自己动手写。网页版讲解偏简略,代码比文字多。

HN 为什么推荐它

HN 上的人把它当作动手学数据库和网络编程的项目书,有人说读完下一个就做它,也有人拿它和 Codecrafters 的同类项目比较;批评是网页版讲解太少,更像代码堆砌。

难度 3 / 5约 20 小时
适合谁

想通过写项目学网络编程和服务端的人

读之前最好知道
1C 语言指针
2基本数据结构
3Linux 命令行

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1准备好 Linux 或 macOS 环境,每章先自己写,再对照书里的代码
  2. 2网页版解释较少,遇到不懂的概念先查 socket 和 epoll 资料
  3. 3同一作者另有用 Go 写数据库的书,可以做完这本再接着读
  4. 4想看更详细的讲解,可以考虑看付费的电子书或纸质版

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
推荐aalhour · 2023-06

“Well, this is awesome. I see that they also have another one on Redis. That will be my next fun project.”

称赞它很棒,并把同站的 Redis 那本当作下一个有趣项目
Ask HN: Books on building databases similar to Crafting Interpreters原评论 ↗
推荐rebelmackerel · 2025-02

“I share the same goal and am working through the material after working through Codecrafters' "Build your own SQLite" [1]. Good luck!”

在做完 Codecrafters 的 SQLite 之后,用它的材料从零构建数据库
Show HN: A Database Written in Golang原评论 ↗
批评hgs3 · 2023-03

“Those webpages are very sparse on actual explanation; they are mostly code dumps.”

批评网页几乎没有讲解,大多只是代码堆砌
Build Your Own Redis with C/C++原评论 ↗
引用znpy · 2023-02

“one thing is not clear from the website: the pages in the content section (say Build Your Own Redis with C/C++ ) are a shortened version of the pages in the epub/pdf/paperback version?”

询问网站内容页是否是 epub/pdf/纸质版的缩略版
Io_uring and Networking in 2023 [pdf]原评论 ↗
引用alex-moon · 2023-03

“Yes and also Build Your Own Redis with C/C++”

补充推荐同一网站的另一本相关书
You can't tell people anything原评论 ↗
引用layer8 · 2023-04

“The book uses Golang for sample code, but the topics are language agnostic. Readers are advised to code their own version of a database rather than just read the text.”

指出示例用 Golang 但主题与语言无关,建议读者自己动手写数据库
The “Build Your Own Database” book is finished原评论 ↗
看全部 9 条 →
引用Lukeisun · 2023-10

“As for db's/other interesting things, I haven't read them myself but this site seems solid Build Your Own Redis with C/C++.”

虽没读过,仍觉得这个网站在数据库等主题上靠谱
Show HN: MicroTCP, a minimal TCP/IP stack原评论 ↗
引用BoingBoomTschak · 2025-02

“Build Your Own Redis with C/C++ goes a bit further, but this is really the point where I decided I wouldn't be able to stand Go.”

说它更进一步,但读到这里就确定自己受不了 Go
Go Data Structures (2009)原评论 ↗
引用LoganDark · 2025-05

“In this case my use of "unsound" is somewhat stretched to "particularly easy to make subtle mistakes as a programmer":”

借它讨论 unsound 一词,引申为程序员特别容易犯细微错误
Reports of Deno's Demise Have Been Greatly Exaggerated原评论 ↗
被提交为 story · 18 次