by blibble · 4y ago · 0 comments
this is pretty easy, you flush the compression buffer every megabyte or so and maintain an index
maybe 50 lines of code
I implemented this as part of the MinIO server. See "Seeking Compressed Files" here: https://blog.min.io/transparent-data-compression/
We choose a compressor without literal compression for a faster baseline, but the concept remains the same.
the index goes in there, no extra seek needed