I store binary files outside of git but keep build logs containing binary file CRCs on git
In git, diffs are literally just a UI thing.
It is.
> Surely Git does have an internal concept of diffing changes
Not in the data model. Packing has deltas, but they're not textual diffs, and they would work fine with binary data... to the extent that the binary data doesn't change too much and the delta-ification algorithms are tuned for that (both of which are doubtful).
> specifically so it knows whether two commits can be merged automatically or if they conflict (because they changed the same lines in the same file).
Conflict generation & resolution is performed on the fly.
It's the same with Git. Don't put large files directly in Git because Git doesn't support that very well, not because it's fundamentally the wrong thing to do.
There should be a name for this common type of confusion: Don't mistake universal workarounds for desirable behaviour.
It was a design constraint back in the day.
I haven’t looked at this in decades, but I think now it’s all just pointers to the file system and not actually bytes in the record.
So it was fundamentally the wrong thing to do based on how databases stored data for performant recall.
But that’s back when disks were expensive and distributed nodes were kind of hard.
It depends. InnoDB, assuming the DYNAMIC row type, will store TEXT/BLOB on-page up until 40 bytes, at which point it gets sent off-page with a 20 byte pointer on-page. However, it comes with a potentially severe trade-off before MySQL 8.0.13: any queries with those columns that would generate a temporary table (CTEs, GROUP BY with a different ORDER BY predicate, most UNIONS, many more) can’t use in-memory temp tables and instead go to disk. Even after 8.0.13, if the size of the temp table exceeds a setting (default of 16 MiB), it spills to disk.
tl;dr - be very careful with MySQL if storing TEXT or BLOB, and don’t involve those columns in queries unless necessary.
Postgres, in comparison, uses BYTEA as a normal column that gets TOASTed (sent off-page in chunks) after a certain point (I think 2 KiB?), so while you might need to tune the column storage strategy for compression - depending on what you’re storing - it might be fine. There are some various size limits (1 GiB?) and row count limits for TOAST, though. The other option is with the Large Binary Object extension which requires its own syntax for storage and retrieval, but avoids most of the limitations mentioned.
Or, you know, chuck binary objects into object storage and store a pointer or URI in the DB.
So you’re right, I’m not going to retrain models costing $100M because of SCM limitations. That’s because I don’t have any SCM limitations.
Your VCS should not be opinionated, that is not its job
I also think it’s one of those situations where if I have a giant binary file in source control “I’m doing it wrong” so git helps me design better.
It’s like in the olden days when you couldn’t put blobs directly in a row so databases made you do your file management yourself instead of just plopping in files.
I like git. I don’t like giant binary files in my commit history. It’s cool that you like fossil, but I don’t see this as a reason for me to use it.