Would it be possible to use Git as a hierarchical text database?
Obviously you would have to write a front end that would act as a middle man, translating user commands into git commands.
A record would correspond to a "file". In the "file", the text would have to have some kind of conventional format like:
[name]: John Doe
[address]: 13 Maple Street
[city]: Plainview
To do queries, you would have to write a grep front end to use git's search capability.
The database itself would be the repository.
The directory structure would be the hierarchical structure of the database.
The tricky part I see would be that you want the records to be in memory, not usually files on the drive (although that would be possible). So you would have to configure git to be working with files in a virtual file system that was actually in the memory of the db middleware.
Kind of a crazy idea, but would it work?
Potential Advantages:
- all the records would be hashed with SHA-1 so there would be high integrity
- git takes care of all the persistence problems
- db operations like edits can be managed as git merges
- db operations like record deletes can be managed as removals (rm)
- all changes to the database are stored, so you can recover ANY change or previous state
- making copies of the database can be done with clone
grepis its own utility, you don't needgitfor what you describe.