Simon Willison built a prototype for storing text revision history in SQLite using zstd-compressed JSON arrays, reducing 20.4MB of data to 80.3KB, an efficient solution for enterprise applications.

1 min read

SQLite compressed text-history prototypes: zstd shrinks 20MB to 80KB

Overview

FAQ

What is the idea of storing compressed text history in SQLite?

The idea is to store all previous versions of a text document in a single JSON array compressed with zstd, significantly reducing data size due to redundancy.

How does this compare to traditional methods?

Traditional methods store each version as a separate row, adding 20KB per edit. This solution compresses all versions together, achieving much better compression.

Can MENA enterprises use this solution?

Yes, especially for collaborative document editing or content management systems, reducing storage costs and improving performance.

Source: Simon Willison (LLM & tools)

AI-assisted content, human-reviewed.