Repository navigation
Description
Summary
Follow-on design ticket from #5676 — its decomposition sketch names this as a separate design, and the parent's acceptance requires these tickets to be filed and linked. Filed in the 2026-11-04 gap pass (WS-F) so the design work exists and can be prioritised on its own merits; implementation timing is a separate decision, possibly months out.
What this design must settle
Sharding by currency across Turso databases, cross-DB transfers composed with the #2063 conversion engine, and rebalancing migrations.
Context from the parent
The parent design fixes the staged currency scaling path — Redis hot store, multi-Turso sharding, TigerBeetle — and the invariants every stage must preserve. The parent issue carries the surrounding decisions this ticket must not re-decide; where this ticket's answer would change a parent decision, record that explicitly rather than silently forking it.
Decision record expected
Close this design with a recorded decision (on this issue or in a doc/ record linked from it): the chosen shape, the alternatives rejected and why, and the invariants implementation must hold. If the design splits further, file the splits and link them here rather than growing this issue.
Relations
Parent: #5676. Programme: epic #2056. Filed by WS-F (2026-11-04 ID design gap & expansion pass).
Activity
developing-today commentedon Nov 5, 2026
CODE-1509
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 5, 2026
🤖 Agent note · triage findings (task 10229, lane code-u, direct lane)
Verdict: VALID design ticket, correctly filed and linked — ORDERED BEHIND ITS PARENT'S DECISION RECORD AND THE STAGE A DESIGN. Not superseded, not yet actionable.
Evidence (fresh, 2026-11-05):
doc/at 04f7869).Ordering / blocker (recorded per triage acceptance):
status/blockednaming this ordering; it clears when the two predecessors land.This triage (task 10229) completes as
triaged; issue #5826 stays open as the design ticket of record.dezren39 commentedon Nov 5, 2026
🤖 Agent note · done
22 remaining items
dezren39 commentedon Nov 16, 2026
Agent note — task 12322 triaged: both gates cleared, design work is the remainder (lane any-c)
dezren39 commentedon Nov 16, 2026
agent-note:v1
lane: code-f, worker repo-worker-code
task: 17435 (repo-health-code-pilot)
event: decision-record delivered (PR open)
summary: Stage B design decision recorded in doc/2026-11-16_design_id5826.md (PR #10769). Shard key is currency — one currency wholly in exactly one Turso DB, whole-currency co-location only, account-range sharding rejected. Cross-DB conversions adopt #5828 §3.2 unchanged (durable coordinator intent, saga-epoch fencing, one durable COMMIT, compensation only before commit, forward-only recovery; no cross-DB atomicity claimed). Routing is a versioned, audited currency→DB directory (epoch, state, schema version) in the metadata store, operated by the ID platform; front-end caches may not override it. Rebalancing is per-currency freeze → saga drain → write fence → copy/replay → pre/post invariant + per-account census → epoch flip → retire, rollback only before the flip accepts writes. Schema: one release version, rolling expand/deploy/backfill/contract. No parent decision changed.
next: PR #10769 needs review/merge; on merge, close #5826 as the recorded decision. Follow-ons (directory tooling, migration tool, per-DB connection management, rolling schema upgrade, Stage B verification legs) are named in §8 and filed when implementation is scheduled.
Merge pull request #10769 from developing-today/queue/17435-5826-stage-b
dezren39 commentedon Nov 16, 2026
Design decision recorded and merged: doc/2026-11-16_design_id5826.md via PR #10769 (merge 94becb8). Shard key = currency; cross-DB conversions adopt #5828 §3.2 saga unchanged; versioned audited currency→DB directory is the sole routing authority; rebalancing is freeze → drain → fence → copy/verify → epoch flip, with rollback only before the flip; one release schema version with rolling DB upgrades. No parent #5676 decision changed. Follow-ons are named in §8 of the record.