NB. This is just an idea, a concept, a design.
For quite some time, the idea of using SQLite in Mycorrhiza has been u/Bouncepaw excited.
SQLite VS files VS other DB
SQLite is an embedded database stored in one file. Compared to external databases, such as PostgreSQL, they are much more simple and easier to maintain. Compared to text files, we have SQL and other stuff that make things easier and more reliable.
After developing Betula, Bouncepaw gained quite a bit of experience of working with SQLite and he is very content with it and looking forward to introducing SQLite to Mycorrhiza.
Backing up Git
Git can be backed up very well. There are so many forges. One could say that SQLite loses this advantage. Indeed, it does. But one should note that to have a full backup of a wiki, backing up git repo only is not enough already, because Mycorrhiza uses an assortment of little text files, mostly JSON, you would have to come with a full backup scheme anyway.
SQLite approaches
Three aprroaches to SQLite approaches are seen with varying grade of SQLite fundamentalism.
Total SQLite. One-file wiki
There is one file, which contains all of wiki with .mycorrhiza
extension. Mycorrhiza works with it. Cache might be there, might be somewhere else, not sure yet.
Everything is there. Categories, interwiki, users, hyphae, history. All.
Of course, it's not that easy. For example, there will be problems with ./static files.
The biggest con is that it will disappoint too many people relying on Git.
Practical SQLite. Everything but hyphae
Everything shall be stored in one .mycorrhiza
file, except for hyphae, which are to remain in the Git repo. We will gain a lot of benefits already.
This is the approach Mycorrhiza will probably take in the coming future. After the Third Great Refactoring, which is underway as of 2024-06-28, the implementation might be started.
Weeny SQLite. In-memory data structure
We can connect to a special SQLite database called :memory:
. It's not saved on disk. Might be beneficial.