Show HN: Versioning Filesystem for SQLite
github.com
github.com
1. Rollbacking DDL changes (like create table, adding columns, etc)
2. (My use-case) Multiple readers-single writer. Readers read old versions. Writers do not block readers and vice-versa. Note: this is different than reading+writing in the same version can still happen but with database-level locking.
3. Extension of #2: The older versions read from S3 so that lamda can read.
4. Extension of #3: Readers reading from old immutable snapshots makes the database as a queue of complex changes with indexes and all the benefits of SQL.
5. Backups and replication.
Oh: I have change the license to MIT
So far, I have been using file copies and GFS backup scheme based solutions like Borg, which also does deltas in chunks, compression, and encryption. Perhaps with Borg one should better even backup SQL dumps instead of db files, I don't know.
Mojo can run on any filesystem which does not support snapshots/versions. This makes it portable not only across different fs but also across OS.
Have a look at https://github.com/sudeep9/mojo/blob/main/design.md#index
I'm not sure how it compares to Borg's delta- and zstd-compression, though.
[1]: http://alexey.shpakovsky.ru/en/minimizing-size-of-browser-pr...
Edit. Regardless of if you maybe even meant that, I made a small test too: A 42 MB db zipped is 8.8M, but its sql dump zipped is 4.9M, so almost half the size. Pretty good already. If you don't just `.dump` but actually output the tables in a consistently sorted manner, the size might go down even more and will enable very efficient delta-ing. Questionable value to effort ratio though...
[1]: https://www.sqlite.org/sqlanalyze.html
On the other side, indeed, text dump is likely not the most space-efficient way of storing raw DB data (compared to some binary one), so I wouldn't be surprised to find databases for which gzipped sql dump is bigger than (gzipped) database itself. I would even say that I'm surprised that it's not true for most databases :)
> AFAIK only one VFS can be active at a time.
You can specify VFS as a part of connect URI.
Some of the use-cases are mentioned at: https://news.ycombinator.com/item?id=32629548
Happy to chat and exchange notes - my email is in the profile.
Speaking of multiple writers, I've recently heard about "BEGIN CONCURRENT" feature of SQLite [1] - currently it lives on its separate branch, but I hope they will eventually merge it to the main branch. Not sure if it can be used in your case, but worth mentioning anyway, I think.
[1]: https://www.sqlite.org/cgi/src/doc/begin-concurrent/doc/begi...
There might be something lost in translation but since there is no licence this is a copyrighted work and cannot be used without permission.
Once you release code under a certain license you can pretty much never undo that. You can change the license, but the previous version under the previous license will still be valid. So I understand wanting to take time to think about what license you will use.