SQLite compressed text-history prototypes
Source: https://simonwillison.net/2026/Aug/9/sqlite-text-history-prototype/
Author: Simon Willison
Summary (EN)
Simon Willison prototyped a SQLite-based text revision history store: bundle all prior versions of a document into a JSON array, then compress the whole blob with zlib or zstd. 1,000 simulated revisions of a 20.4 MB document compressed to 80.3 KB. To avoid decompressing/recompressing the entire history on each edit, the chunked variant breaks history into rows of max 128 revisions or 3MB uncompressed JSON. Two approaches compared: WholeBlobHistoryStore (rewrite one compressed blob per edit) and ChunkedHistoryStore (sealed compressed chunks for scaling). Both skip unchanged replacements and serialize writers with BEGIN IMMEDIATE.
摘要中文
Simon Willison 原型了一种基于 SQLite 的文本修订历史存储方案:把所有历史版本放入 JSON 数组,再整体压缩。1000 次模拟修订的 20.4 MB 原始文本压缩到 80.3 KB。为避免每次编辑都全量解压缩,分块变体将历史拆成最多 128 次修订或 3MB 的块。适合笔记、编辑器、本地工具的实现参考。