I've got a git repository having such arborescence :
- app
- data
- README.md
Files inside "data" are usually JSON files that are updated after some users actions on front side. When a file has been updated, I would like to commit & push it to have an history.
Is it a good idea to use git as a "database", in the same git repo than source code ? Maybe it would be cleaner to create a dedicated repo just for the data ?
I thought about this solution because my JSON files are small and not updated frequently. I think I would spend more time creating a database with MariaDB than just saving my data in a file. Also I need a historic, and I must have that files on 2 places (in case the main server crashes). The JSON files are independent and do not share the same data structure.
I think I would spend more time building a databaseThat's an interesting comment :). E.g. I've been writing software for 25 years in varied fields and never once built, or thought to build, a database - why are the only two choices 'use json files' or 'build a database'... where is use a preexisting database? sqlite sounds like it would be one suitable candidate. You can do what you ask (do not store data in the same repo as code, use two repos), but it's abnormal - and the info provided for wanting to do it that way don't justify the approach. Good luck :)