Explore this guide
A real-time odds API delivers updates with some delay; reliability engineering makes that delay visible and determines when the data is safe to use. “Connected,” “receiving messages” and “ready for trading decisions” are different states.
For an SRE, trading operations team or technical buyer, the useful question is not simply which provider advertises the lowest latency. It is which failure modes can be detected, which decisions are restricted and what evidence is required to recover or switch feeds.
This guide focuses on operational measurement, SLOs and failover tests. The odds ingestion pipeline guide covers adapter, queue and cache implementation. All numerical examples and pseudocode below are illustrative, not production results or recommended universal thresholds.
Define what real-time means for your product
An odds comparison page, a trading dashboard and an acceptance service have different consequences when updates are delayed. Set the required behavior for each consumer before comparing provider claims.
Provider timing also depends on the product and delivery model. SportsDataIO's timing reference describes varying update characteristics across feeds. It is evidence that timing needs a product-specific definition, not a benchmark for every odds API.
Write an operational statement such as: “For supported active markets, the acceptance service uses a reconstructed view with verified producer health and continuity; when that evidence is missing, affected acceptance is restricted.” Then define how the service observes and tests each condition.
Do not equate a quick HTTP response with a recent market observation. A fast endpoint can return an old snapshot, and a stream can remain active while one relevant producer is degraded.
Measure latency at named boundaries
Use separate measurements rather than combining unrelated durations into one “latency” number:
| Measurement | Boundary | Important limitation |
|---|---|---|
| Event-to-publication delay | Sporting event or source observation to published update | Often not independently observable |
| Publication-to-receipt age | Provider timestamp to adapter receipt | Depends on timestamp meaning and clock accuracy |
| Processing delay | Local receipt to applied state | Must include queueing, not just worker execution |
| Delivery/display delay | Applied state to consumer presentation | Requires client observation for actual display timing |
| Recovery duration | Restriction start to verified ready state | Socket reconnect alone is not completion |
In a hypothetical trace, a message is published at 12:00:00.000, received at .120 and applied at .180. Receipt age is 120 ms and local processing delay is 60 ms; publication-to-application age is 180 ms, subject to clock assumptions. Nothing here measures the sporting event's original observation time.
Use synchronized wall clocks for cross-system comparisons and monotonic elapsed timing within a process. Record clock uncertainty and reject implausible future timestamps according to a defined policy. After restart, rebuild process-local timing evidence rather than reusing an old monotonic value.
Report distributions and sample coverage by product, producer and market scope. A pooled percentile can conceal a delayed minority. State measurement location, period, load and excluded observations before using results in a vendor comparison.
Pipeline and health boundaries
- 01Source publication
Document timestamp meaning and provider health
- 02Adapter receipt
Capture receipt time and continuity evidence
- 03Queue + processing
Measure pending age and guarded state application
- 04Readiness gate
Publish usable, restricted or recovering status
- 05Consumer decision
Separate display, analysis and acceptance policy
- 06SLO + response
Observe fixed-cadence samples and controlled failover
The diagram identifies where health evidence is produced and consumed. Its steps are logical boundaries, not a mandatory technology stack.
Preserve provider timestamps, receipt times, processing times and continuity metadata. Carry recovering or restricted status alongside prices. A cache API that exposes only a numeric price prevents downstream consumers from applying the intended health policy.
Partition processing consistently where order matters. Treat documented sequences within their stated scope and opaque cursors as tokens. Timestamp ordering alone does not establish one global order across independent feeds.
Use a recovery generation or equivalent write guard to prevent an older worker from replacing a newer reconstructed state. The readiness decision should be published with the same guarded state, not set by an unrelated background task after a reconnect.
Heartbeats, unchanged odds and stale data
An unchanged price can be legitimate. A moving price can still be delayed. Separate market activity from evidence of delivery health and local processing progress.
Betfair's heartbeat documentation states that server heartbeats carry no market data. Sportradar's alive documentation defines producer-health and recovery signals. Apply the relevant contract, rather than refreshing every market's “fresh” flag whenever any socket message arrives.
For producer health, track expected liveness and reported degradation. For local processing, track queue age and the latest successfully applied continuity point. For snapshots or periodically refreshed products, define a product-specific maximum usable age. Not every incremental market needs a price change at that cadence.
Illustrative stale-data decision
This pseudocode describes a policy boundary. Its helper functions and thresholds require a real provider contract and test implementation; it is not executable provider code.
usable(view, producer, pipeline, policy, now):
if view.missing or view.recovering:
return false
if not view.continuity_verified:
return false
if producer.degraded or not producer.current_process_health_known:
return false
if now.monotonic - producer.last_valid_health_receipt > policy.health_gap:
return false
if pipeline.oldest_pending_age > policy.max_processing_delay:
return false
if pipeline.continuity_unresolved:
return false
if policy.requires_periodic_state_refresh:
if not view.source_time_trustworthy:
return false
if now.wall - view.state_verified_at > policy.max_state_age:
return false
return view.market_status_allows_action
Validate future timestamp bounds and clock assumptions before setting source_time_trustworthy. state_verified_at must come from valid state evidence, not an unrelated heartbeat. The function deliberately has no “last price change was too long ago” rule.
Market usability is only one input to acceptance. Account restrictions, funds, limits and authoritative execution rules still apply. The exchange API reliability guide explains that distinction.
Controlled failover between primary and backup feeds
A backup that responds is not necessarily a valid substitute. Before failover, verify market identity, periods, lines, outcome definitions, timestamps, permissions and settlement authority. Decide whether backup data may support display, trading analysis or acceptance; those are different permissions and risk decisions.
Maintain mappings before the incident and test them against real contracted schemas. If the backup has a broader or narrower market definition, restrict the unsupported scope rather than presenting it as equivalent.
Use an explicit handover sequence:
- Restrict the affected decisions and announce degraded status.
- Establish the backup's permitted scope and current health.
- Load a validated snapshot and verify continuity requirements.
- Switch one guarded state generation and record the evidence.
- Resume only the actions approved for that scope.
- Plan a similarly controlled return to the primary.
Avoid mixing incremental updates from two providers into one market cache without a defined ownership rule. A later timestamp does not resolve incompatible market semantics.
A backup feed also cannot resolve orders submitted to the primary exchange. Keep order reconciliation with the authoritative execution system. Data failover and financial recovery require separate runbooks.
Circuit breakers, retries and graceful degradation
Use bounded retries with backoff and jitter for transient connection failures, respecting provider limits and existing client-library behavior. AWS's retry guidance explains why synchronized retries and repeated side effects require care.
A circuit breaker can stop repeatedly calling a failing dependency and allow controlled probes. Its open/half-open/closed status is not proof that market state is usable; the readiness gate still requires valid state and continuity.
Degradation should be deliberate: hide unavailable actions, mark recovering markets, retain explanatory status and keep support evidence. Do not silently display old prices as current to improve a superficial uptime metric.
Different failure classes need different owners. Authentication and permission failures usually need correction. Network recovery can retry. Unknown order outcomes need reconciliation before a replacement command. Repeatedly executing all three paths in one retry loop can amplify an incident.
SLOs and operational reporting
Google's SRE workbook explains the relationship between indicators, objectives and error budgets. Apply that method to the user decision you need to support, then separately track the technical causes.
An illustrative indicator could sample each eligible active market at a fixed cadence and count whether verified state is usable. Define eligible markets, sample cadence, missing observations, deliberate suspensions and the reporting window before calculating a percentage. Sampling only incoming updates would undercount a silent outage.
In a hypothetical report, 200,000 eligible observations include 1,000 unusable observations: usable availability is 199,000 / 200,000 = 99.5%. This is arithmetic, not a proposed provider guarantee. A different denominator or exclusion policy changes what the figure means.
Keep at least three views distinct:
- Usable-state availability: can this consumer make the permitted decision?
- Restriction effectiveness: are decisions blocked when required evidence fails?
- Recovery performance: how long until the required state is verified again?
A feed can reduce availability while the safety restriction works correctly. Do not hide that distinction in one green dashboard tile. Set objectives with trading, product and operations based on observed behavior and business consequences.
Monitoring and incident response
Alert on sustained age, continuity gaps, backlog growth, recovery failures and unexpected changes in restricted scope. Include producer, affected product, last known-good evidence and runbook links. Avoid placing unnecessary player or order data in high-cardinality metric labels.
For incidents, assign a lead, operations owner and financial-reconciliation owner where orders are affected. Preserve raw evidence where permitted, configuration versions, clock state and recovery generations. Keep a timeline separating source behavior, local detection and operator action.
Disaster recovery needs more than reconnecting a stream. Recreate credentials and subscriptions, restore durable records, obtain supported state and reconcile external financial activity since the restore point. UOF's recovery documentation illustrates why recovery completion and current-state reconstruction are specific protocol concepts.
Rehearse the decision to resume. Record who authorized it and which checks passed. A runbook should also describe what to do when evidence remains ambiguous, rather than ending at “restart the service.”
Practical reliability tests
Use a simulator or authorized replay corpus with explicit expected results:
| Injection | Observe |
|---|---|
| Silent connection stall | Fixed-cadence monitoring detects lost health even with no price changes |
| Heartbeats continue but consumer processing stalls | Backlog/continuity evidence prevents a false ready state |
| Out-of-order or duplicate updates | Documented update semantics preserve the correct view |
| Clock jumps or future source timestamp | Invalid age evidence is flagged rather than treated as fresh |
| Recovery races an old worker | Generation guard prevents stale overwrite |
| Backup has a mismatched market | Unsupported failover is refused or restricted |
| State store is lost | Rebuild establishes continuity before affected actions resume |
| External order response is lost | Financial reconciliation proceeds independently of feed switching |
Report expected and actual state, time to restriction, time to recovery and unresolved limitations. These are proposed test cases; no live provider results are implied. The event-day traffic guide adds capacity and overload considerations.
For a sports data integration review, bring current schemas, measurements and incident examples. Those artifacts help turn “we need faster odds” into a defensible reliability plan.
Frequently asked questions
Is a connected WebSocket enough to declare the feed healthy?
No. Verify the relevant producer, local progress and continuity. The transport can stay active while usable market state is delayed.
Should unchanged odds automatically expire?
Not as a universal rule. Use the provider's product-specific health and refresh contract. A quiet incremental market can remain valid without price changes.
Can failover be entirely automatic?
Only for a prevalidated scope with defined mappings, permissions, state ownership and readiness criteria. Unverified substitutes should remain restricted.
What latency should an odds API guarantee?
There is no useful universal number. Define the measured boundary, clock assumptions, observation coverage and consumer requirements before setting or comparing an objective.
What is the difference between an SLO and a provider SLA?
An SLO is the objective you define for a measured service indicator. A provider SLA is a contractual commitment with its own scope, exclusions and remedies. Your usable-market objective may include local processing failures that the provider's contract does not cover.
How can we detect an outage when no new odds arrive?
Use the documented producer liveness/refresh contract and independent fixed-cadence observations of current state. Monitoring only incoming price messages can miss silence. Do not invent a universal timeout for every market and provider.
Is adding another provider enough to guarantee resilience?
No. The backup may have incompatible markets, shared dependencies or different rights and settlement meaning. Validate the supported failover scope and exercise handover/recovery before relying on it.
How can reliability tests avoid accidental live orders?
Use a simulator, authorized replay data or a suitable provider sandbox, with execution adapters isolated from production credentials. State explicitly which behaviors are simulated and which interfaces are exercised. A simulated result is useful evidence for that model, not a live provider performance claim.
Further reading