Maglev Cycle 11: CockroachDB Score Write
The Context
With causal ordering confirmed in Cycle 10 and the DB connection verified in Cycle 4, Cycle 11 activates persistence: the persona zone commits the score and multiplayer-fabric-uro writes it to CockroachDB.
The Problem Statement
The cross-zone write path — persona zone commits, uro writes via Ecto over Fly’s 6PN using the gateway_writer role — requires end-to-end validation. With causal ordering confirmed in Cycle 10, the only remaining unknown is whether the database write path performs correctly under mission load.
Design
On each core-slot event the persona zone commits the score update after the VClock.le check passes. On mission end multiplayer-fabric-uro writes the committed score to CockroachDB via Ecto over Fly’s 6PN using the gateway_writer role. RelReplica entries stamped with sentAt are broadcast to the interest band.
Write path:
spatial zone → QueueOp(VClock) → persona zone commits
→ uro → CockroachDB (gateway_writer, Fly 6PN)
→ RelReplica(sentAt) broadcast to interest band
Pass criteria:
Estimate
5 days (2026-06-30 → 2026-07-07). The Ecto write path to CockroachDB is proven in Cycle 4; the work is the persona zone commit flow, VClock gating on the write side, and RelReplica broadcast. No prior end-to-end causal write exists in the history.
CRIS Score
| Factor | Score | Evidence |
|---|---|---|
| Complexity | 6 | The Ecto write path to CockroachDB over Fly’s 6PN under concurrent mission load is untested in this codebase. |
| Reach | 10 | Persistent player progression requires this path. |
| Impediment | 8 | A broken score write does not block Cycle 10 gameplay but blocks any feature that depends on persistent state. |
| Stakeholder | 10 | Required for the full Maglev Intercept scenario. |
| Total | 8.0 | Build after Cycles 10 and 9 pass. |
The Downsides
If the persona zone goes down, that player’s attributes are offline until it recovers. Replication factor ≥ 2 on the persona partition is the mitigation, deferred to a later cycle.
The Road Not Taken
Writing scores directly from the spatial zone to CockroachDB was considered. Rejected — it violates DisjointRanges and allows concurrent writes to the same player record.
Status
Status: Draft
Decision Makers
- Lead Architect / Fabric Maintainer
Further Reading
@misc{v_sekai_2026,
title = {V-Sekai},
year = {2026},
url = {https://v-sekai.org/}
}