I want to:
- Archive millions of tiny files ...
- Each file is about 1-3KB of size
- Plain UTF-8 text
- Contents largely similar (logfiles)
- ... into larger archives ...
- Say, 1 days worth of files in each archive (about 2GB uncompressed)
- ... with "solid" compression ...
- To save on storage costs (we're hosting in The Cloud) I want to be able to efficiently compress the files, which means that the compression should look for patterns across files, not just compress each file individually. This is sometimes known as a "solid" archive, although the name might vary.
- ... and be able to efficiently extract single files.
- I wish to build a tool which allows a human to locate and inspect individual files inside the archives, so I want to be able to extract individual files relatively quickly. All archive formats that I'm familiar with that have "solid" mode available (7zip, RAR, TAR+gzip/bzip2/whatever) require that all previous files be decompressed as well, since the compression just treats all individual files as one single large data stream. This means that files at the start are quick to access, while the files at the end of the archive will require decompressing (and discarding) the entire archive before the last file can be reconstructed.
- Compression speed doesn't matter. It can be slow. It can require lots of disk space or RAM. What matters is that the end result is compact and quick to access randomly.
Ideally this would be available as a library for PHP or NodeJS, however command line tools are acceptable too.