mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-27 10:35:36 -06:00
The old strategy for writing values was to recursively encode them, putting the resulting chunks into a BatchStore from the bottom up as they were generated. The BatchStore implementation was responsible for handling concurrency, so chunks from different Values would be interleaved if the there were multiple calls to WriteValue happening at the same time. The new strategy tries to keep chunks from the same 'level' of a graph together by caching chunks as they're encoded and only writing them once they're referenced by some other value. When a collection is written, the graph representing it is encoded recursively, and chunks are generated bottom-up. The new strategy should, in practice, mean that the children of a given parent node in this graph will be cached until that parent gets written, and then they'll get written all at once.