Distributed System Illustrated: https://xitter.cf/t.co/CKxHlT9TMn,https://xitter.cf/t.co/yjUeoLnOHk

China,GuangZhou
Joined May 2009
《图解分布式系统原理》已在小报童专栏( xiaobot.net/p/DSI )上线,本系列的完整初稿全部在本人博客公开:codedump.info/dist-system-cn… 付费专栏提供的是排版后的精美pdf版本的下载,在pdf版本中:润色了文字,对比博客初稿多出了前言、目录、参考文献。选择小报童的原因是因为跟微信强绑定,对国内的读者而言相对友好。 I’ve written <<Distributed System Illustrated — a visual guide for engineers>>-focused guide to distributed systems. It covers clocks & order, replication, partitioning, transactions, consensus (Paxos/Raft), and more — with diagrams and intuitive explanations instead of dense proofs. Start reading: codedump.info/dist-system-en… Get the e-book: leanpub.com/distributed-syst…
4
5
21
3,354
纳闷儿为啥图一的内容一直发不出来,测试了之后发现原来是这个域名直接被X禁了。
885
最近有一则不大不小的新闻:沿用了半个世纪的闰秒被取消了,见《再见了,闰秒》(sohu.com/a/1091976535_122014…)。 《图解分布式系统原理》(codedump.info/dist-system-cn…)的第三章《分布式系统中的时间和顺序》(codedump.info/dist-system-cn…)中,详细解释了: * 计算机的物理时间是怎么来的 * 什么是闰秒问题 * 物理时间漂移问题,以及给线上系统造成的故障等等。 只有理解了这些,才能理解为什么分布式系统不能用物理时间来衡量两个事件的先后顺序。
1
20
2,145
我把已经续订三个月的Ollama的20美刀套餐给退了,理由是:之前用这个套餐是为了用各家开源模型,现在感觉Deepseek v4.1 flash对我日常的工作而言已经够用了,而如果用这个模型,那这个套餐经常是用不完的,后面就改用Deepseek官方的API即可。 ​​​​ 用一句最近流行的话来说:很多模型,已经掉入了Deepseek V4.1 flash模型的“斩杀线”了。
2
6
1,171
我现在觉得很幸运:在前AI编程时代,我积累了不少‘手搓代码’的经验。这就像在开始大规模敲键盘之前,先刻意练了很多年字——那些早年的手搓练习,训练了我的审美,也沉淀了我的经验。
1
7
857
rockraft 0.2.0 发布 🚀 github.com/lichuang/rockraft - 转发接入连接池:follower 写不再每请求新建 gRPC 连接 - 重试 5s 总预算 + jitter:选举期不再悬挂 90 秒、不再雪崩 - apply 零拷贝:每 KV 少两次堆拷贝 - membership 单一事实来源、快照安装原子切换、last_applied 同批提交 - 新增四档读一致性:leader_applied / local_applied / lease_read / read_index - 旧快照自动清理,磁盘不再无限增长
4
678
生产端极大丰富,导致吸引人们的注意力越来越难。而如果一个东西建造成本变得越来越低,其营销成本也变得越来越高。
1
1
503
十几年前第一次看到波士顿动力的机器狗演示,和今天很多人看到特斯拉飞行汽车,是一个感觉:惊艳、领先我们多年、追不上。 如今波士顿动力何在?中国这边的宇树,这几年已经量产并完成了上市。等量产真正有人买单了,我们再来看——一个产品,最终不是靠演示说话的。
2
1,009
btreelite:github.com/lichuang/btreelit… 早几年还在做数据库的时候,一直想知道理论的btree算法,最终如何落地为一个生产上的实现,例如要如何解决以下的问题(这些问题都在“sqlite3.36版本 btree实现(零)- 起步及概述”): 如何处理不同大小的数据的存储? 删除一个数据之后,如何复用其留下的空间? 错误、崩溃恢复怎么做? 跟磁盘文件是如何交互的? 页面缓存模块如何实现? 围绕这些问题,一直想找一个小而精的btree实现,后来完整阅读了sqlite3.36版本的btree实现,整理成了系列博客:sqlite3.36版本 btree实现:codedump.info/post/20211217-…。 在这以后,一度想把sqlite的这部分内容单独抽出来成为一个独立的btree实现的KV库,但是碍于精力和复杂度一直没有成行。 中秋国庆假期,突发奇想:既然现在有了AI工具,可以借助它们的辅助来实现这个项目,就是现在看到的btreelite项目。这里面最大的改动是:sqlite的btree其实有两个,字符串key首先映射到一个整数类型的rowid,然后再以row id映射到真正的数据,而btreelite只有一个btree,就是直接使用字符串key映射到真实的数据。 目前项目的代码量有五万多行,我后面再看看是否还能够继续裁剪掉不必要的功能精简代码量。 我不知道这样的项目今天是否还有意义,不管怎么说还是做了出来。
1
1
19
1,378
Based on an article I wrote a few years ago on the methodology of reading code, “How to Read a Piece of Source Code?” (codedump.info/en/post/202006…), I compiled it into a how-to-read-code skill: github.com/lichuang/how-to-r…. Here is an example of reading the flow of how Redis handles client requests and generating a report: github.com/lichuang/how-to-r…
8
827
我基于前几年写的一篇阅读代码方法论的文章《如何阅读一份源代码?》(codedump.info/zh/post/202006…),整理成了一个how-to-read-code skill : github.com/lichuang/how-to-r… ,在这里有一个阅读redis处理客户端请求流程生成报告的例子:github.com/lichuang/how-to-r…
3
37
1,899
蔡康永事件发生后,才了解到他的父亲是太平轮的船主之一。太平轮,号称“东方泰坦尼克号”,在1949年1月27日从上海出发开往基隆港的过程中,由于严重超载,撞上货轮后沉没,详见维基百科页面太平轮沉没事件。 在这次事件后,五位太平轮的股东中,只有周庆云一家留在了大陆,最后耗费30年时间还清了赔付死者和自身的债务。 很遗憾,如今的互联网上,已经搜不到这个周庆云的身份、背景了,能找到的一篇报道是《太平轮后事:沉船之后的人和事》。在动乱的年代,有这样的担当实属不易。
3
1,769
The company Turso (github.com/tursodatabase/tur…), which rewrote SQLite in Rust, has been acquired by Supabase: "Turso is joining Supabase to give every agent its own database (turso.tech/blog/turso-is-joi…)" Personally, I think SQLite is good enough, but in the current agent era, it doesn’t seem good enough anymore. For example, while I was writing semquery (github.com/lichuang/semquery), I kept looking for an embedded database that could simultaneously support SQL queries, vector queries, and graph database functionality. SQLite makes this a bit difficult. Maybe this Turso is worth looking into.
2
4
798
数据库早已形成自己的一套理论,比如什么btree、lsm、MVCC等等,但是在agent memory领域还远远没有:哪些数据该存、存成什么格式、如何提炼,等等,可以说现在agent memory这个领域还在非常早期的阶段。
2
1
1
20
1,681
最近看了好几个Rust相关的新闻,比如: * Rust在微软内部升级为一级语言:《Guest Post: Rust Is Tier-1 Language at Microsoft》 * Copilot将Runtime从Python迁移到了Rust: 《Migrating the GitHub Copilot runtime to Rust, using Copilot》 我的感受: * Rust干掉的是原先C++的增量市场。这在以前,大家一想到要用一门系统级编程语言、或者把原先存在的项目由于性能原因改写,都会想到C++、C。但是现在,Rust基本吃掉了这部分增量市场。存量的大量老的C++项目也许不会动,但是增量快没有了。以数据库领域来看,最近五年唯一拿得出手的新起来的C++写的项目,好像只有Duckdb。有人会说Mysql、Postgresql这些项目都是C,拜托,这些都是旧的项目。 * 越容易给AI反馈的语言,越能在AI时代胜出。这里的反馈,也就是编译器的编译输出。从这一点上,编译型语言是占优的。而Rust还有更细致的编译反馈,例如类型系统,例如Rust只要能够通过编译就可以保证没有内存问题,这两点都是C++没有的。 在TIOBE排行榜上,Rust的排名也从2025年9月份同期的18名,攀升到了2026年9月份的第十名。
1
6
1,262
semquery v0.4.0 is out 🚀 : github.com/lichuang/semquery… A local-first RAG tool written in Rust — your documents, models, and queries never leave your machine. The headline change in this release is lazy model loading: ⚡ semq status / semq add open instantly — no more forced model loading 📥 Models download on first use, with visible progress; fully offline afterwards 💬 ask now streams answers token by token, plus a fix for silently truncated output For developers: Engine::open is now the single API entry point — models load on first stream use via OnceCell; all stream events (IndexEvent / SearchEvent / AskEvent) carry ModelDownloadStart/Complete as tagged. GitHub: github.com/lichuang/semquery
1
410
I ran a performance test on CoreDB. It’s a Redis-protocol-compatible KV service based on the Raft consensus protocol, using RocksDB for underlying data storage. As expected, the three-node cluster’s performance is terrible—but doesn’t that just mean there’s plenty of room for optimization? coredb: github.com/lichuang/coredb rockraft: github.com/lichuang/rockraft
2
797
There is no global clock in a distributed system. That single fact breaks most of our everyday intuition about time. Two nodes can disagree about what time it is by seconds. A message can arrive at a receiver whose clock says it was sent in the future. And when you try to sync clocks with NTP, the protocol quietly assumes the network is symmetric, which is almost never true in the real world. Chapter 3 of my visual guide tackles time and order in distributed systems. It starts from the ground up: how events produce state, why state machine replication depends on event order, and why physical time is fundamentally unreliable for ordering events across nodes. It then walks through the practical and theoretical tools engineers use to deal with this mess: wall clocks vs monotonic clocks, leap seconds and their infamous outages, how NTP synchronization actually works, causality and the happened-before relation, partial order vs total order, Lamport clocks, and vector clocks. If you have ever wondered how systems like Kafka, CockroachDB, or Spanner reason about “what happened first,” this chapter gives you the mental models. Read it free: codedump.info/dist-system-en… PDF ebook: leanpub.com/distributed-syst…
1
5
610
Rust has killed off C++'s incremental market. In other words, it will be hard for purely C++-written systems to appear going forward. I saw someone say that classic DBs are all written in the C family, like PostgreSQL, MySQL, etc. Ridiculous. Look at the databases that have emerged in the last five years: among C-family databases, only DuckDB can hold its own.
1
1
1,090