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
| Column | Type | Description |
|---|---|---|
| entry_id | BIGSERIAL | global order |
| event_idFK | UUID FK → event | |
| seq | INT | per-event sequence |
| occurred_at / recorded_at | TIMESTAMPTZ | match time vs ingestion time |
| source | TEXT | 'manual:tagger_42' | 'feed:opta' | 'scraper:x' |
| granularity | TEXT | DETAIL | SUMMARY |
| entry_kind | TEXT | PLAY | CORRECTION | VOID | RULING |
| play_type | TEXT | 'cricket.delivery', 'boxing.punch' |
| payload | JSONB | Blueprint-validated event envelope |
| corrects / voids | BIGINT NULL | pointers to the amended entry |
Sample data · live from octopus
loading…