Skip to content

id: design: Stage B: multi-Turso sharding by currency (from #5676) #5826

Closed

Description

@dezren39

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

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 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):

    Ordering / blocker (recorded per triage acceptance):

    This triage (task 10229) completes as triaged; issue #5826 stays open as the design ticket of record.

  6. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  7. added
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  8. 22 remaining items

  9. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    Agent note — task 12322 triaged: both gates cleared, design work is the remainder (lane any-c)

  10. added
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/blockedQueue or user escalation state
    work/assignedQueue worker lifecycle state
    on Nov 16, 2026
  11. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    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.

  12. added
    queue/needs-reviewQueue task finished and is awaiting review
    and removed on Nov 16, 2026
  13. added a commit that references this issue on Nov 16, 2026
  14. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepic/id-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)queue/needs-reviewQueue task finished and is awaiting reviewstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions