{"id":"hybrid-fanout-instantiates-adaptive-cost-model","text":"The hybrid fan-out strategy is the codebase's most explicit instantiation of access-frequency-adapted cost allocation: the celebrity threshold converts the abstract principle (shift work to the cheaper path based on access pattern) into a concrete runtime decision boundary, dynamically partitioning authors between write-amplified push and read-time merge-pull to bound both paths simultaneously.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["hybrid-fanout-bounds-both-write-and-read-cost","cost-model-adapts-to-access-frequency"],"outlist":[],"label":"the celebrity threshold makes the per-use-case cost adaptation principle into a concrete, observable mechanism"}],"dependents":["adaptation-is-bidimensional-across-frequency-and-risk"],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"hybrid-fanout-instantiates-adaptive-cost-model","truth_value":"IN","reason":"SL justification valid","antecedents":["hybrid-fanout-bounds-both-write-and-read-cost","cost-model-adapts-to-access-frequency"],"label":"the celebrity threshold makes the per-use-case cost adaptation principle into a concrete, observable mechanism"},{"node":"hybrid-fanout-bounds-both-write-and-read-cost","truth_value":"IN","reason":"SL justification valid","antecedents":["news-feed-hybrid-splits-on-follower-count","news-feed-pull-uses-heap-merge"],"label":"Threshold caps write fan-out; heap merge caps read materialization — each path has an independent cost bound"},{"node":"news-feed-hybrid-splits-on-follower-count","truth_value":"IN","reason":"premise"},{"node":"news-feed-pull-uses-heap-merge","truth_value":"IN","reason":"premise"},{"node":"cost-model-adapts-to-access-frequency","truth_value":"IN","reason":"SL justification valid","antecedents":["read-cost-scales-with-system-complexity","write-cost-allocation-matches-access-pattern"],"label":"Read cost scales with complexity (depth-4) and write-cost allocation matches access patterns (depth-4) — combining shows the cost model is adaptive, not dogmatic"},{"node":"read-cost-scales-with-system-complexity","truth_value":"IN","reason":"SL justification valid","antecedents":["reads-bear-full-correctness-burden","deletion-strategy-scales-with-distribution"],"label":"deletion strategy scaling from soft-delete to tombstones directly increases what the read path must interpret and reconcile"},{"node":"reads-bear-full-correctness-burden","truth_value":"IN","reason":"SL justification valid","antecedents":["read-path-absorbs-consistency-and-computation-cost","deletion-is-metadata-in-replicated-systems"],"label":"Both depth-2 conclusions shift complexity to reads — one for computation/convergence, the other for deletion semantics — together establishing reads as the locus of correctness"},{"node":"read-path-absorbs-consistency-and-computation-cost","truth_value":"IN","reason":"SL justification valid","antecedents":["lazy-read-time-evaluation-trades-write-simplicity-for-read-cost","kv-read-path-is-self-healing"],"label":"lazy eval (autocomplete decay, URL expiration, payment balance) defers computation to reads; KV read repair defers convergence to reads — the combined pattern reveals a systematic bias toward read-path complexity across the repo"},{"node":"lazy-read-time-evaluation-trades-write-simplicity-for-read-cost","truth_value":"IN","reason":"SL justification valid","antecedents":["autocomplete-decay-is-read-time","url-shortener-expiration-lazy","payment-balance-never-cached"],"label":"Three independent systems chose lazy evaluation, suggesting write-simplicity is the dominant concern in pedagogical implementations"},{"node":"autocomplete-decay-is-read-time","truth_value":"IN","reason":"premise"},{"node":"url-shortener-expiration-lazy","truth_value":"IN","reason":"premise"},{"node":"payment-balance-never-cached","truth_value":"IN","reason":"premise"},{"node":"kv-read-path-is-self-healing","truth_value":"IN","reason":"SL justification valid","antecedents":["kv-read-repair-on-get","kv-node-stores-sibling-versions"],"label":"Read repair + sibling detection make the read path an active consistency mechanism, not just a query"},{"node":"kv-read-repair-on-get","truth_value":"IN","reason":"premise"},{"node":"kv-node-stores-sibling-versions","truth_value":"IN","reason":"premise"},{"node":"deletion-is-metadata-in-replicated-systems","truth_value":"IN","reason":"SL justification valid","antecedents":["soft-delete-prevents-distributed-resurrection","append-only-versioning-makes-restore-non-destructive"],"label":"both depth-1 conclusions independently arrive at the same principle — never physically destroy data — but for complementary reasons (anti-resurrection vs non-destructive restore); combined they show this is a fundamental constraint of any system that replicates or versions state"},{"node":"soft-delete-prevents-distributed-resurrection","truth_value":"IN","reason":"SL justification valid","antecedents":["kv-store-deletes-use-tombstones","s3-delete-marker-hides-not-removes"],"label":"Both systems independently arrived at write-over-delete to prevent resurrection from unsynchronized replicas"},{"node":"kv-store-deletes-use-tombstones","truth_value":"IN","reason":"premise"},{"node":"s3-delete-marker-hides-not-removes","truth_value":"IN","reason":"premise"},{"node":"append-only-versioning-makes-restore-non-destructive","truth_value":"IN","reason":"SL justification valid","antecedents":["s3-version-list-append-only","gdrive-restore-creates-new-version"],"label":"Append-only version lists make restore a forward operation, not a rollback"},{"node":"s3-version-list-append-only","truth_value":"IN","reason":"premise"},{"node":"gdrive-restore-creates-new-version","truth_value":"IN","reason":"premise"},{"node":"deletion-strategy-scales-with-distribution","truth_value":"IN","reason":"SL justification valid","antecedents":["soft-delete-is-dual-purpose","kv-anti-entropy-covers-writes-and-deletes"],"label":"Soft delete for structure preservation and tombstones for distributed convergence are complementary layers that compose"},{"node":"soft-delete-is-dual-purpose","truth_value":"IN","reason":"SL justification valid","antecedents":["soft-delete-preserves-structural-invariants","soft-delete-prevents-distributed-resurrection"],"label":"Both depth-1 soft-delete conclusions identify different motivations (structural invariants vs. resurrection prevention) for the same technique, revealing dual utility"},{"node":"soft-delete-preserves-structural-invariants","truth_value":"IN","reason":"SL justification valid","antecedents":["chat-soft-delete-preserves-sequence","autocomplete-delete-is-soft"],"label":"chat keeps deleted messages with `[deleted]` content to preserve sequence numbering; autocomplete zeroes frequency without removing trie nodes to preserve tree structure — both are single-node structural concerns distinct from distributed anti-resurrection"},{"node":"chat-soft-delete-preserves-sequence","truth_value":"IN","reason":"premise"},{"node":"autocomplete-delete-is-soft","truth_value":"IN","reason":"premise"},{"node":"kv-anti-entropy-covers-writes-and-deletes","truth_value":"IN","reason":"SL justification valid","antecedents":["kv-read-path-is-self-healing","soft-delete-prevents-distributed-resurrection"],"label":"without read repair, write divergence persists; without tombstones, deletes get resurrected — both mechanisms are independently necessary for full convergence"},{"node":"write-cost-allocation-matches-access-pattern","truth_value":"IN","reason":"SL justification valid","antecedents":["write-read-cost-allocation-is-per-use-case","writes-are-cheap-reads-pay"],"label":"the per-use-case allocation strategy resolves an apparent contradiction with the reads-pay default by correlating write cost with read frequency"},{"node":"write-read-cost-allocation-is-per-use-case","truth_value":"IN","reason":"SL justification valid","antecedents":["eager-rebuild-trades-write-cost-for-derived-consistency","lazy-read-time-evaluation-trades-write-simplicity-for-read-cost"],"label":"These two depth-1 conclusions represent opposite strategies for the same problem (when to compute derived state), revealing a spectrum rather than a convention"},{"node":"eager-rebuild-trades-write-cost-for-derived-consistency","truth_value":"IN","reason":"SL justification valid","antecedents":["autocomplete-cache-consistency","leaderboard-update-by-remove-reinsert"],"label":"autocomplete rebuilds top_k_cache for all ancestor nodes on every trie mutation; leaderboard removes and reinserts entries on score update — both choose O(mutation) rebuild over eventual consistency of derived structures"},{"node":"autocomplete-cache-consistency","truth_value":"IN","reason":"premise"},{"node":"leaderboard-update-by-remove-reinsert","truth_value":"IN","reason":"premise"},{"node":"writes-are-cheap-reads-pay","truth_value":"IN","reason":"SL justification valid","antecedents":["write-time-decisions-are-lightweight-but-binding","read-path-absorbs-consistency-and-computation-cost"],"label":"Write-side minimalism and read-side cost absorption are two faces of the same design tradeoff, consistently applied across KV, chat, news feed, autocomplete, and payment"},{"node":"write-time-decisions-are-lightweight-but-binding","truth_value":"IN","reason":"SL justification valid","antecedents":["fan-out-write-pushes-references-not-data","write-time-routing-is-irrevocable"],"label":"Fan-out pushes references (lightweight) and routing decisions are permanent (binding) — the write path optimizes for speed at the cost of flexibility"},{"node":"fan-out-write-pushes-references-not-data","truth_value":"IN","reason":"SL justification valid","antecedents":["chat-fanout-on-write","news-feed-fan-out-write-pushes-ids"],"label":"Reference-based fanout limits write amplification to pointer-sized payloads"},{"node":"chat-fanout-on-write","truth_value":"IN","reason":"premise"},{"node":"news-feed-fan-out-write-pushes-ids","truth_value":"IN","reason":"premise"},{"node":"write-time-routing-is-irrevocable","truth_value":"IN","reason":"SL justification valid","antecedents":["news-feed-celebrity-threshold-at-write-time","chat-fanout-on-write"],"label":"news feed selects fan-out-on-write vs fan-out-on-read based on follower count at publish time; chat routes to inbox or offline queue based on presence at send time — both decisions are baked in at write time and not revisited"},{"node":"news-feed-celebrity-threshold-at-write-time","truth_value":"IN","reason":"premise"}]}}