My usecase is silly. Basically small to medium database backed cms websites. I just want to evolve them as the client already is using them to serve and store content. Also have up to date complete backup of them in git.
I could do it easily if I just kept data in text files instead of sqlite, but I really like the speed of the database queries.
Maybe the other way around? Use database triggers on inserts an updates to store the data in files as well? And create a procedure to update the database from files after git pull?
I agree that would be easier to implement, but it violates the SSOT principle by introducing an edge case of lost database changes that have not been written to the files (for example during a system error).
Comments
My usecase is silly. Basically small to medium database backed cms websites. I just want to evolve them as the client already is using them to serve and store content. Also have up to date complete backup of them in git.
I could do it easily if I just kept data in text files instead of sqlite, but I really like the speed of the database queries.
Why not set the text files as the SSOT and have a hook that populates the database when the files change?
Maybe the other way around? Use database triggers on inserts an updates to store the data in files as well? And create a procedure to update the database from files after git pull?
I agree that would be easier to implement, but it violates the SSOT principle by introducing an edge case of lost database changes that have not been written to the files (for example during a system error).