scorebookSCOREBOOK
The system of record. An append-only ledger of everything that happens in every event: each play, each correction, each void, each official ruling. Rows are never updated and never deleted — a fix is a new CORRECTION row pointing at the original, an official decision (DLS result, stewards' demotion) is a RULING. Every derived table in the platform can be deleted and rebuilt from this one.
What this table stores: One row per recorded happening: a cricket delivery, a punch, a raid, a chess move, a point-of-call, a finish — with per-event sequence, dual timestamps (when it happened vs when we learned of it), the originating source, entry granularity, and a payload validated against the sport's Blueprint play-type contract.
Key behaviors & rules
  • UNIQUE (event_id, source, seq) makes ingestion idempotent — the same entry delivered twice is a no-op, which is essential with scrapers and unreliable feeds.
  • granularity DETAIL vs SUMMARY supports scorecard-first entry: totals arrive first for a fast scoreboard, ball-by-ball backfills later, and a reconciliation check compares them.
  • occurred_at vs recorded_at separates match time from ingestion time — late and out-of-order data is absorbed without loss.
  • At scale this is the only billion-row table: append-only writes, monthly partitions, per-event reads via (event_id, seq); reads for clients never touch it — they hit scoreboard.
  • Sample data here includes all four entry kinds — find the CORRECTION (runs 1→2), the VOIDed duplicate-feed entry, the result RULING, and the SUMMARY-granularity scorecard row.
Columns
ColumnTypeDescription
entry_idBIGSERIALglobal order
event_idFKUUID FK → event
seqINTper-event sequence
occurred_at / recorded_atTIMESTAMPTZmatch time vs ingestion time
sourceTEXT'manual:tagger_42' | 'feed:opta' | 'scraper:x'
granularityTEXTDETAIL | SUMMARY
entry_kindTEXTPLAY | CORRECTION | VOID | RULING
play_typeTEXT'cricket.delivery', 'boxing.punch'
payloadJSONBBlueprint-validated event envelope
corrects / voidsBIGINT NULLpointers to the amended entry
Sample data · live from octopus
loading…