Bet Slip Events: Schema Evolution Lessons from the Igaming Floor

iGaming December 04, 2026
Bet Slip Events: Schema Evolution Lessons from the Igaming Floor

Why bet slips are harder than they look

Bet slips look like one of the simplest objects in igaming: a customer picks a few selections, stakes some money, and waits. Under the bonnet, though, a bet slip is a sequence of events. It is created, priced, re-priced, partially cashed out, settled, voided, or migrated to a new promotion. Once you put those events on a stream, your schema becomes a product surface. Every consumer, from risk to CRM to regulatory reporting, builds assumptions on it. That is where the lessons start.

Treat the bet slip as an event, not a table row

The first trap is treating the bet slip as a single mutable row. In an event stream, you are not publishing the current state; you are publishing facts about what happened. A bet slip event should say what changed, when, and under which rules. If you model it as a table snapshot, you will spend years retrofitting history, reconciliation and audit trails. If you model it as an event, you still have schema problems, but they are at least honest ones.

A useful starting point is a thin, explicit envelope around a payload. The envelope stays stable; the payload evolves. Keep it boring and include more than you think you need:

  • event_id, bet_id, customer_id and correlation_id, so you can trace a bet across systems.
  • event_type, occurred_at and recorded_at in UTC, with a clear distinction between business time and ingestion time.
  • schema_version, producer name and environment, because “which service sent this?” is a question you will ask at 2am.
  • jurisdiction, currency, channel and responsible gambling flags, because reporting and compliance consumers need them without joining back to another system.

That envelope lets you add new event types without rewriting every consumer. It also makes replay safer: you can filter by version or producer before you deserialise the payload. Many readers also find หวย helpful here.

Additive changes are your friend

The most reliable schema evolution rule in betting is simple: add optional fields, do not remove or rename existing ones. A bet slip model will grow. Cash out arrives. Partial cash out arrives. Free bets, odds boosts, bet builders and system bets arrive. If you planned for a single stake and a single return, you will need optional fields such as cash_out_amount, free_bet_id and promotion_type. Give them sensible defaults and document what null means. Null should mean “not applicable or unknown”, not “zero” and definitely not “the customer did not have a free bet”. Ambiguity here turns into reconciliation errors later.

Renaming a field is removing it with extra steps. If you must change semantics, add a new field and deprecate the old one in public. Keep both populated for a migration window. Consumers can move at their own pace, and your historical replays still work.

Decimals, timestamps and other traps

Betting is full of numbers that look harmless until they are not. Odds, stakes, payouts and cash-out values should not be floats. Use decimal strings or minor units with an explicit currency. A timestamp without a timezone is a rumour. Publish UTC and include the source timezone where it matters for regulatory reporting. Avoid changing a field from integer to string in place; add a new field with the new type and migrate. Also think about arrays: adding an optional field to an array element is usually fine, but changing the meaning of an existing element is a breaking change.

Versioning needs governance, not just a registry

A schema registry is necessary but not sufficient. You need a lightweight compatibility policy, automated checks in CI, and a human owner for the bet slip domain. In practice, that means:

  • Run backward compatibility checks on every producer change and block breaking changes unless there is an approved migration plan.
  • Use consumer-driven contracts for the highest-risk consumers, such as settlement and regulatory reporting.
  • Canary new schema versions to a small percentage of traffic and watch deserialisation errors, not just latency.
  • Document deprecation dates and keep a compatibility matrix that non-engineers can read.

Replay is the real test

The best schema review is a replay. Take a week of historical bet slip events and run them through the new consumer. You will discover assumptions about ordering, duplicates and missing fields that no design document caught. Partition by bet_id so events for the same slip stay ordered, make consumers idempotent, and route poison messages to a dead letter queue with enough context to investigate. Observability matters too: track schema version by consumer, deserialisation failures, and lag per partition.

Schema evolution is product evolution in disguise. In igaming, the bet slip will keep changing as promotions, regulation and customer behaviour change. If you start with an explicit envelope, additive changes, honest types and a replay habit, you will spend less time firefighting and more time shipping. The alternative is a stream full of events nobody can safely read.