3 ms·
I have a question for database wizards! I'm developing an application that uses lots of little blobs of JSON to represent objects. (Who isn't?) I'm going to p
by DonHopkins 12y ago
I have a question for database wizards!
I'm developing an application that uses lots of little blobs of JSON to represent objects. (Who isn't?)
I'm going to put them into a database, probably Postgres, maybe also Mongo or something like that.
I'd like to keep the important JSON objects checked into git, either with the source code they belong to, or as a separate repo. It needs to export and import them all one to a file, as normalized pretty printed JSON, so git can track and merge changes line by line, and recreate the entire system including source code and matching data at a later point in time. Not everything in the database needs to be tracked in git, just the important bits of JSON that need to be kept in sync with the code.
What I want to avoid is having a huge monolithic database backed up in a different way and on a different schedule as the source code is being tracked, so the important JSON data is mixed up with bulky transient tables in SQL dumps, so it's slow and tedious to recreate the source code with the matching data. What I want is for it to be easy to track and merge and revert changes to that important JSON data, and to back up the data in lock step with the source code that depends on it.
Somebody must have tried something like this before -- is it a crazy idea, or is there a better approach, or some system that tackles this problem already? Thanks in advance!
- rpedela 12y agoHow much data are we talking about? If it is small and static, then it can probably just be stored in git. If it is dynamic and/or large, the typical solution is to have a separate table with diffs and timestamps. You could even add the git checksum since you want it synced with git. I would love to be more helpful. If you want to talk further about your particular problem and possible solutions, please contact me: rpedela at datalanche.com