docs: rewrite README — sync model, version-vector design, and tradeoffs - #69
Merged
Conversation
The README described pivot in five lines and a stale route table. Replace it with a deep explanation aimed at someone deciding whether to adopt it: - What pivot is (AP state-sync for ooo, embedded Go library, leader/follower) and its CAP positioning. - The full data flow: node→leader push (with VV idempotency guard + merge + originator-skip fan-out), leader→node trigger fan-out, and catch-up via sync-on-read / on-start / re-trigger (not a polling loop), plus delete tombstones. - Version vectors: what they are and WHY — causal ordering that survives clock drift — and the conflict policy: VV dominance decides; on true concurrency the leader wins the round (last-sync-wins, leader-convergent), with wall-clock timestamps used only as a no-VV fallback and the glob-push tiebreak. - Strengths and pitfalls, including the leader-dials-nodes reachability constraint and leader-convergent (non-merging) concurrency resolution. - A comparison table positioning pivot against rqlite/dqlite, Litestream, CouchDB/PouchDB, ElectricSQL/PowerSync, CRDT libraries, and etcd. Corrects the stale route table to the actually-registered /_pivot routes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CBosch101
approved these changes
Jun 9, 2026
CBosch101
left a comment
Contributor
There was a problem hiding this comment.
Docs-only rewrite of the README into an adopt-or-not explainer of the sync model, VV design, and tradeoffs. Verdict: APPROVE — I independently fact-checked the technical claims against the source and they hold.
Verified against source:
- Idempotency guard —
handlers.go: skips onVVGreater/VVEqual(returns 200, writes nothing), proceeds onVVLess/VVConcurrent, with bump + merge-on-receive after the write. Matches the README's step-by-step exactly. - Roles —
LeaderID = "leader", role decided byClusterURL == ""; tombstone-first-then-Delordering andStoragePrefix = "pivot/"are as described. - The load-bearing claim that wall-clock
Updatedis not the primary resolver: confirmed. The single-key timestamp comparison only fires in the no-VV cold-start fallback, and the glob per-element timestamp compare only fires on the non-authoritative branch — whenever both sides carry a VV, direction is derived from VV alone. - Routes table, the
X-Pivot-VV/X-Pivot-Originatorheaders, the unauthenticated/versionprobe,Port <= 0⇒ data-not-node, and the sync-tuned default client (short dial timeout + pooling) all match the code.
No blockers. The comparison table's external positioning claims are properly sourced; reasonable for a docs PR.
🤖 Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The README explained pivot in a few lines and carried a stale route table. This rewrite turns it into a document someone can actually decide to adopt (or not) from — it exposes how synchronization works internally and justifies the design.
What the new README covers:
Also corrects the stale HTTP route table to the routes actually registered under
/_pivot.Docs-only change; no code touched. Every technical claim was fact-checked against the source (roles, push/pull/trigger flow, the VV idempotency guard and merge, last-sync-wins concurrency resolution, tombstone ordering, the route set, and the protocol header constants).
🤖 Generated with Claude Code