Repository navigation
Conversation
[High impact] The PR appears safe to merge; the latest change fixes the previously reported overwrite. SummaryAdds optional zstd compression using a dictionary trained from stored events.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Startup without dictionary] --> B[Begin immediate transaction]
B --> C[Read events and train dictionary]
C -->|Usable dictionary| D[Store dictionary and rewrite events]
D --> E[Commit]
E --> F[Use dictionary]
C -->|No dictionary or error| G[Roll back]
Reviews (4) · Last reviewed commit: "fix(datastore): take the write lock befo..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #618 +/- ##
===========================================
+ Coverage 70.81% 85.31% +14.49%
===========================================
Files 51 88 +37
Lines 2916 12555 +9639
===========================================
+ Hits 2065 10711 +8646
- Misses 851 1844 +993 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
@greptile review |
Benchmark: dictionary compression on a real-world databaseTest data: byte-for-byte snapshot of a live database, 544,673 events across 19 buckets (~12.5 months of Methodology:
Results:
Other notes:
|
Why a custom implementation instead of
|
…Watch#493) Opt-in `compression-zstd` feature: once a database has enough events, train a zstd dictionary on them, store it in a new `compression_dict` table (db v7), and store each event's data compressed against it. Rows that would not shrink, and all rows when no dictionary exists, stay plain TEXT, so a build without the feature writes exactly what it did before. Readers accept TEXT, raw-JSON BLOB, or a compressed BLOB, so v4-v7 peer databases remain readable by read-only opens. A reader connection reloads the dictionary if the writer trains one after it opened. Rows that cannot be decompressed are treated like corrupt JSON and skipped with a warning.
a9cea74 to
e58f4ab
Compare
@greptile review |
@greptile review |
closes #493