git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git for structured data

From
CSCedric Sodhi <manday@openmail.cc>
Date
Dec 7, 2025, 17:23 UTC
Message-ID
<aTW4EsiThW7WFwSl@air>
In-Reply-To
<2ae0a2d5-e909-4c51-9459-83f5c6950d51@hogyros.de>
Hi Simon
If your suggestion at this point would be that I consider implementing an VCS in the database instead of basing it on Git, I'll be sceptical. I'd end up re-implementing Git's features.
I agree with many things you say. There is no magic recipe to apply Git to relational databases; specific tools -- at the very least one per database type, but possibly tailored further to the specific data it holds -- would have to be written.
However, I do think Git generalizes to RDBS more readily than it may seem and, in fact, one method to map a DB into a filesystem-isomorphic thing which Git knows how to handle, would fit 99% of all cases. Your example from KiCad (which can be understood as content which are stored in a RDBS), could be a good illustration:
If you normalize the file (one element per line) by sorting by UIDs corresponding to the individual elements, then you'd see no diff unless either UID or contents change. And UIDs typically wouldn't change unless you actually delete-and-recreate something. Every table in the DB which is normalized that way could be mapped as a single file. Of course a more granular mapping table-file or even row-file would be possible. In fact, mapping one row (or element of the Schema/Layout) per file would exploit Git's ability to detect "moves" meaning that you wouldn't even need UIDs for the elements to create good diffs. There is power in the semantics of the filesystem hierarchy which you lose when all contents become a single database/KiCad-file.
In short: In my opinion, there really doesn't seem to be any algorithmic difficulty. The only thing that stops Git from doing praticable versioning of databases is its inability to access its contents transparently in any of most trivial manners.

Best, Cedric

Previous: Simon Richter
Message 6 of 6 in “Git for structured data”
  1. Cedric SodhiDec 5, 2025
  2. René ScharfeDec 6, 2025
  3. Cedric SodhiDec 6, 2025
  4. Christian CouderDec 6, 2025
  5. Simon RichterDec 7, 2025
  6. Cedric SodhiDec 7, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.