Notes/XKV

XKV Swaps Changes Between Stores and Keeps the Reasons With Them

XKV 0.2.0 adds exchange. One store exports its recent changes as a file, another imports it, and every change arrives with its actor, reason, ref and causes, so Why gives the same chain on both sides. Think of a service and its staging copy, two sites that each take writes, or a laptop that was offline for a day.

Each change carries what its writer had seen of the key, so an import can tell an update from a conflict without trusting clocks. In a conflict the later change wins on every store and the other one stays in the key’s history. Twenty pairs and 90 rings, stars and meshes of stores, with clocks up to 74 minutes apart, all ended with the same values; 40 kills during an import left nothing half done; a fuzzer rewrote files 3.6 million times without a panic. Stores from 0.1 open as before and upgrade with one command. Watch, a live stream of new changes, is next.