|
~/writing/whatnext/queue-sync
[↑↓]nav[⏎]go[spc]expand

Keeping a distributed queue in sync without a server round-trip

The core problem in WhatNext: multiple people add tracks to a shared queue from different devices, and everyone should see the same order fast, without round-tripping to a central server on every reorder.

The approach I'm testing

A CRDT-ish ordered list keyed by fractional indices. Each insert picks a position between two existing keys, so two clients inserting concurrently rarely collide.

StrategyConflict rateComplexity
Integer indices + lockhighlow
Fractional indexinglowmedium
Full CRDT (RGA)nonehigh

Starting with fractional indexing — it's the cheapest thing that survives concurrent edits. I'll revisit a full CRDT only if rebalancing becomes a problem.