![]() Previously, LMDB was used for storing threads, but it consumed excessive disk space and was capped at 1GB. This change migrates thread storage to an SQLite database. Thread JSON objects are now compressed using zstd. I considered training a custom zstd dictionary and storing it in a separate table. However, the additional complexity outweighed the modest space savings (up to 20%). I ended up using the default dictionary stored with data. Threads can be exported relatively easily from outside the application: ``` $ sqlite3 threads.db "SELECT hex(data) FROM threads LIMIT 5;" | xxd -r -p | zstd -d | fx ``` Benchmarks: - Original heed database: 200MB - Sqlite uncompressed: 51MB - sqlite compressed (this PR): 4.0MB - sqlite compressed with a trained dictionary: 3.8MB Release Notes: - Migrated thread storage to SQLite with compression |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |