The layering that works
Names vary by stack; the responsibilities do not. Four layers, each with one job:
| Layer | Job | Rule that keeps it honest |
|---|---|---|
| Raw / landing | Events exactly as received from the schema | Immutable. Nothing is fixed here — fixes are new events upstream |
| Conformed core | Deduplicated, identity-resolved, currency-normalised facts at source grain | One player key, minor-unit integers, both clocks preserved |
| Metric layer | The dictionary implemented as code — one place per metric | Dashboards may not define metrics; they may only display them |
| Marts | Consumer-shaped views: finance periods, CRM player states, regulatory snapshots | Shapes diverge, definitions do not |
The third layer is the one most operations skip, and it is where the recurring disputes come from: when every dashboard computes its own GGR from the core, the organisation has as many definitions as dashboards. Moving the computation into one governed layer is the structural fix — the dictionary made executable.
Grain: decide once, at the bottom
Keep facts at the finest grain the source produces — bet-selection, transaction, event. Every aggregate is derived and disposable; the fine grain is neither. Three iGaming-specific grain traps:
- Ticket-level gameplay facts. Multi-leg bets misattribute margin across markets and products the moment anyone slices below the ticket. Selection level or regret.
- Daily player aggregates as the base. They bake in one timezone and one cut-off forever. Aggregate views can be rebuilt per market timezone only if the base is event-grain.
- Snapshot-only state. Balances, verification states and bonus states need transition history, not just current values — the difference between answering "what is" and "what was", and the second question is the audit question.
Time: the two-clock discipline, downstream
The schema carries event time and processing time; the warehouse decides what each consumer sees. The workable convention: operational and CRM marts read event time (players live in event time), finance and regulatory marts read settlement/accounting time with an explicit reopening window, and every externally reported figure gets a frozen snapshot. The revenue bridge then reconciles between clocks by design rather than by monthly negotiation.
Restatement: the rule nobody writes until it hurts
Late events are structural in this industry — settlements, chargebacks, voided markets, regulatory corrections. The design answer is a written restatement policy: which facts may change a closed period and for how long, which published aggregates re-state versus freeze, and how a restatement is itself recorded as an event. This is the same lineage discipline as regulatory reporting — the warehouse is where it either exists or does not.
The consumers, explicitly
| Consumer | Needs | Design consequence |
|---|---|---|
| Finance | Stable periods, reconciled to the cashier and the ledger | Accounting-time mart, frozen snapshots, restatement log |
| CRM / operations | Fresh player state, actionable within minutes | Event-time mart with latency SLO; freshness monitored like uptime |
| Risk / RG | Complete protection and activity join, fast | Protection events in the core with money-grade completeness |
| Regulator / audit | Reproducible historical answers | Append-only lineage from filed figure back to raw events |
Writing this table for your own operation — with named owners per row — is worth more than any tooling choice. Most warehouse redesigns are really the discovery that one consumer's needs were never stated.
What to monitor
- Freshness per mart, against its stated SLO — staleness discovered by a user is a trust event, not an incident ticket.
- Reconciliation deltas — warehouse revenue versus cashier and ledger, daily, with a tolerance and an owner.
- Restatement volume — a rising trend means an upstream source is degrading, long before anyone complains.
- Definition drift — any metric computed outside the metric layer, caught by review; the count should be zero and stay zero.
Continue reading: Cohort analysis — the discipline the marts exist to serve. Dashboards by role — the last mile.