I am looking for an existing solution for transparent SQLite 3 zlib compression using a custom VFS implementation and a custom IO methods implementation.
Is anyone aware of an existing project that already does that, or will I have to roll my own? I vaguely remember seeing something similar a year ago, but can't find it anymore.
The SQLite Compressed and Encrypted Read-Only Database (CEROD) Extension is an add-on to the public domain version of SQLite that allows an application to read compressed and encrypted database files in addition to ordinary SQLite database files.
SQLite database files have a maximum size of about 140 TB. On a phone, the size of the storage (a few GB) will limit your database file size, while the memory size will limit how much data you can retrieve from a query. Furthermore, Android cursors have a limit of 1 MB for the results.
The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. When overwriting the original, a rollback journal or write-ahead log WAL file is used just as it would be for any other database transaction.
The SQLite3 database will just return the single record that you wanted directly. So your "sequential file" is 50,000 times slower than SQLite3 at retrieving data.
The Compressed and Encrypted Read-Only Database (CEROD) SQLite extension does compression, and is available from the authors of SQLite. It is a commercial add-on.
You could also use a compressed filesystem via FUSE, such as FuseCompress or compFUSEd, which transparently compresses the sqlite file using zlib, lzo, or bzip2.
Edit: There is also a separate solution that you can load as an extension, sqlitecompress.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With