Odds that keep up with the match · Codelabs
RU|EN|KK
← All cases
CASE 03Real-time betting pipeline

Odds that keep up with the match

A bookmaker receives a stream of odds changes across 12 sports. They have to be sorted by match instantly and pushed to every open browser so that nobody sees a stale price and manages to bet on it. We wrote our own core in C++ and our own delivery protocol for this: if a player loses the connection, they get a correctly restored picture rather than garbage.

Real-timeC++Betting

How it works

The feed arrives over two channels, REST and AMQP, and is normalised into a single model across 12 sports. The snapshot of the line sits in Redis, around 0.9 million live keys; from there only the changes travel.

Distribution runs over an in-house protocol on top of WebSocket: the order of events is guaranteed, a dropped connection does not leave the client with fragments, and batching keeps the browser from drowning during peak hour.

The core is written in C++ and had to be built in a particular way: Qt was rebuilt from source because the stock build could not digest the large JSON responses of the feed. In production since 2020. The same stream is packaged as a separate B2B product: a 1220-line guide, a reference ETL and an automatic conformance validator with HTML reports.

In numbers

  • ·12 sports in one stream
  • ·in production since 2020
  • ·the same stream is sold to partners as a separate product

Describe your task — we will tell you what part of it we have already built