Back to Overview
01
From RabbitMQ to Tyk

Unified Sportsbook API Gateway

Betfred's sportsbook currently relies on RabbitMQ as the message broker for 40+ gaming provider data feeds. While RabbitMQ delivers reliable AMQP messaging, it was never designed to be an API management platform. This initiative charts the evolution from RabbitMQ to Tyk, consolidating message brokering, API governance, security, and analytics into a single platform with zero disruption.

Current State Assessment

RabbitMQ: Betfred's Integration Backbone Today

RabbitMQ serves as the central message broker for sportsbook data ingestion. Providers like Sportradar, Betgenius, and SIS publish odds feeds over AMQP 0-9-1, which RabbitMQ routes to internal consumer services via exchanges and queue bindings. This architecture has served Betfred well for reliable message delivery, but it leaves critical gaps that limit the platform's ability to scale, govern, and optimise.

Current Data Flow

📡
Sportsbook Providers
Sportradar, Betgenius, SIS, IMG Arena — AMQP 0-9-1 feeds
🐰
RabbitMQ Broker
Exchanges, queues, bindings — reliable message routing
⚙️
Custom Consumer Code
Bespoke per-provider parsing, validation, and transformation
🖥️
Betfred Applications
Sportsbook, trading desk, risk management, mobile apps

What RabbitMQ Does Well

Reliable AMQP message delivery with acknowledgements
Pub/sub pattern via exchanges and queue bindings
Producer/consumer decoupling for async processing
Dead letter queues for failed message handling

The Gaps: What RabbitMQ Cannot Provide

Capability
What Betfred Needs
RabbitMQ Status
API Governance
Unified policy enforcement across 15+ providers
Not Available
Security Layer
OAuth2, JWT, mTLS, per-consumer access controls
Basic Auth Only
Rate Limiting
Event-aware throttling for Grand National peaks
Not Available
Analytics
Real-time latency, errors, consumption per provider
Queue Metrics Only
Developer Portal
Self-service API discovery and subscription
Not Available
Data Transformation
Canonical data model enforcement across all feeds
Not Available
Protocol Bridging
AMQP to HTTP / WebSocket / SSE / gRPC
AMQP Only
Auto Failover
Automatic provider failover under 1 second
Manual Only
Cumulative Impact of These Gaps
8 to 12 weeks
New provider onboarding
£1.2M/yr
Integration maintenance cost
5 to 15 min
Manual failover time
Zero
API-level visibility
The Evolution Path

From RabbitMQ to Tyk: One Platform, Zero Disruption

Tyk Streams natively supports AMQP 0-9-1, the same protocol RabbitMQ uses. This means Tyk can directly consume from sportsbook providers, perform message routing, transformation, and fan-out, while simultaneously providing API governance, security, analytics, and a developer portal. One platform replaces two, eliminating an entire infrastructure component.

Capability Comparison

Capability
RabbitMQ
Tyk + Streams
AMQP 0-9-1 Protocol
Message Routing & Pub/Sub
Reliable Delivery & Ack
API Governance & Security
Rate Limiting & Throttling
Real-Time Analytics Dashboard
Developer Portal
Data Transformation Engine
Protocol Bridging (Multi-Protocol)
Automatic Provider Failover
GraphQL Federation / UDG
Circuit Breaker Patterns

Future State Data Flow

📡
Sportsbook Providers
AMQP, HTTP, Kafka, WebSocket feeds
🛡️
Tyk Gateway
Auth, rate limit, transform, circuit breaker
🌊
Tyk Streams
AMQP consumption, fan-out, enrichment
🔌
Managed APIs
HTTP, WebSocket, SSE, gRPC endpoints
🖥️
Betfred Apps
Sportsbook, trading, mobile, risk

Tyk Streams natively supports AMQP 0-9-1 input/output connectors. This means Tyk can directly consume from the same providers that currently publish to RabbitMQ, eliminating the need for a separate message broker entirely.

How Tyk Streams Replaces RabbitMQ

Tyk Streams AMQP Configuration

# Tyk Streams - Direct AMQP Consumer
input:
  amqp_0_9:
    urls:
      - amqp://sportradar:5672
      - amqp://betgenius:5672
    queue: betfred.odds.live
    consumer_tag: tyk-gateway
    prefetch_count: 100

pipeline:
  processors:
    - mapping: |
        root.event_id = this.eventId
        root.market = this.market
        root.odds = this.selections
        root.provider = meta("amqp_routing_key")
        root.timestamp = now()

output:
  http_client:
    url: https://api.betfred.internal/odds
    verb: POST
    headers:
      Authorization: "Bearer ${JWT_TOKEN}"
      Content-Type: application/json

What This Enables

Direct Provider Connection

Tyk Streams connects directly to provider AMQP endpoints, consuming odds feeds without an intermediary broker.

Inline Transformation

Messages are transformed to the canonical data model within the stream pipeline, no custom consumer code required.

Multi-Protocol Output

A single AMQP input can fan out to HTTP REST, WebSocket, SSE, and gRPC consumers simultaneously.

Governed by Tyk

All stream processing inherits Tyk's security policies, rate limiting, analytics, and audit logging.

Zero-Disruption Migration

Three-Phase Migration: RabbitMQ to Tyk

The migration is designed to be progressive and zero-disruption. Phase 1 adds governance without changing existing flows. Phase 2 progressively migrates provider feeds. Phase 3 decommissions RabbitMQ entirely.

Phase 1

Governance Layer

Months 1 to 3
Low Risk
RabbitMQ Status
Running (unchanged)

Tyk deployed alongside RabbitMQ. Connects to existing queues as a consumer. Immediate visibility, security enforcement, and analytics without touching existing data flows.

Key Deliverables
Tyk Hybrid deployment on AWS
3 priority provider feeds governed
Analytics dashboard operational
JWT authentication enforced
Phase 2

Provider Migration

Months 4 to 8
Medium Risk
RabbitMQ Status
Feeds progressively migrating

Provider feeds progressively migrated from RabbitMQ to Tyk Streams direct AMQP consumption. Tyk Streams natively supports AMQP 0-9-1, enabling direct provider connection.

Key Deliverables
15+ providers on Tyk Streams
Canonical data model enforced
Protocol bridging active
Developer portal launched
Phase 3

Decommission

Months 9 to 12
Low Risk
RabbitMQ Status
Decommissioned

All 40+ provider feeds running on Tyk Streams. RabbitMQ fully decommissioned. Single platform for all API management, event streaming, and data governance.

Key Deliverables
All providers on Tyk
RabbitMQ decommissioned
Full GraphQL federation
Grand National load tested
Technical Architecture

Tyk Hybrid Deployment Architecture

Tyk Gateway deployed in hybrid mode: control plane in Tyk Cloud for management, data plane on Betfred's AWS infrastructure (eu-west-2) for data sovereignty and sub-5ms latency.

Tyk API Gateway Architecture
Edge Layer
AWS CloudFront CDNWAF RulesDDoS ProtectionTLS 1.3 TerminationGeographic Routing
Tyk Gateway
Go Middleware PipelineJWT ValidationRate LimiterCircuit BreakerRequest/Response Transform
Tyk Streams
AMQP 0-9-1 ConsumerMessage Fan-OutInline TransformationDead Letter HandlingBackpressure Control
Canonical Model
Protocol Buffers v3REST to gRPC TranslationXML to JSON NormalisationField Mapping EngineSchema Versioning
Observability
Prometheus MetricsGrafana DashboardsDistributed TracingAlert ManagerSLA Monitoring

Request Flow: Sportsbook Data Ingestion via Tyk

🌐
Provider FeedREST, gRPC, WebSocket, or AMQP push from provider
🔒
Auth & Rate LimitJWT validation, per-provider quota enforcement
🔄
Protocol TransformConvert to canonical Protobuf schema
📊
Enrich & ValidateSchema validation, field mapping, data enrichment
Route & CacheIntelligent routing with Redis-backed caching
📱
Consumer DeliveryNormalised API response to Betfred services

Implementation Specifications

Gateway Performance Targets

Gateway Latency (p99)
< 5ms
Throughput
50,000 req/sec sustained
Peak Throughput (Grand National)
500,000 req/sec burst
Uptime SLA
99.99%
Provider Failover
< 200ms automatic
Cache Hit Ratio Target
> 85% for odds data

Deployment Configuration

Deployment Model
Tyk Hybrid (Cloud CP + Local DP)
Data Plane Location
AWS eu-west-2 (London)
Gateway Instances
6 active + 6 standby
Redis Cluster
6-node cluster, 3 shards
Auto-Scaling
HPA based on req/sec + latency
Blue/Green Deployments
Zero-downtime via Argo CD

Rate Limiting Tiers

Tier 1 (Premium Providers)
10,000 req/sec per provider
Tier 2 (Standard Providers)
5,000 req/sec per provider
Tier 3 (Basic Providers)
1,000 req/sec per provider
Burst Queue Depth
5,000 requests
Circuit Breaker Threshold
50% error rate over 30s
Recovery Window
60s half-open, 300s full reset

Tyk Streams Configuration

AMQP Protocol
AMQP 0-9-1 (native)
Prefetch Count
100 messages per consumer
Fan-Out Targets
HTTP, WebSocket, SSE, gRPC
Transformation
Bloblang mapping engine
Dead Letter Queue
Automatic after 3 retries
Backpressure
Adaptive based on consumer lag

Why Tyk: Competitive Analysis

Tyk was selected after evaluating it against Kong, AWS API Gateway, Apigee, and MuleSoft for Betfred's sportsbook requirements. The critical differentiator is Tyk Streams, which provides native AMQP support that eliminates the need for RabbitMQ entirely.

CriterionTyk + StreamsKongAWS API GWRabbitMQ (Current)
AMQP Native SupportYes (Tyk Streams)No (plugin)NoYes (core)
API ManagementFull platformFull platformLimitedNone
Deployment FlexibilityHybrid (cloud + on-prem)HybridCloud-onlySelf-hosted only
Open Source CoreYes (Apache 2.0)Yes (Apache 2.0)NoYes (MPL 2.0)
GraphQL/UDG SupportNative Universal Data GraphPlugin-basedLimitedNone
Streaming + API in OneYes (unified)No (separate)NoStreaming only
Developer PortalBuilt-inSeparate productLimitedNone
UK Data ResidencyFull controlFull controlAWS regions onlyFull control
Before & After

Architecture Transformation: Toggle to Compare

Switch between Betfred's current RabbitMQ architecture and the proposed Tyk future state to see the transformation at a glance.

Interactive Architecture View

Current: RabbitMQ-Centric Architecture
Current: RabbitMQ-Centric Architecture
📡
Providers
40+ feeds via AMQP only
🐰
RabbitMQ
Message broker, no governance
⚙️
Custom Code
Bespoke parsers per provider
🔓
No Auth Layer
Basic credentials, no JWT/mTLS
🖥️
Betfred Apps
Tightly coupled consumers
CURRENT PAIN POINTS
No API-level visibility into provider health or latency
8–12 weeks to onboard each new provider (custom code required)
Manual failover taking 5–15 minutes during outages
£1.2M/year spent maintaining bespoke integration code
No rate limiting — vulnerable to provider-side traffic spikes
Zero security governance — basic credentials only
Financial Case

Total Cost of Ownership: RabbitMQ vs. Tyk

A direct comparison of annual operational costs between maintaining the current RabbitMQ infrastructure with custom integration code versus the proposed Tyk unified platform.

Annual Operational Cost Comparison

Cost CategoryRabbitMQ (Current)Tyk Platform (Future)Annual Saving
Message Broker InfrastructureRabbitMQ cluster: 6 nodes, HA config, monitoring£180,000£0£180,000
Tyk Gateway + Streams LicenceTyk Enterprise hybrid deployment£0£240,000-£240,000
Custom Integration Code4 FTE developers maintaining bespoke parsers → 0.5 FTE config£480,000£60,000£420,000
Provider Onboarding Labour8–12 weeks per provider → 3–5 days via portal£320,000£80,000£240,000
Incident Response & FailoverManual failover + on-call → automated circuit breakers£150,000£30,000£120,000
Monitoring & ObservabilityCustom dashboards → built-in Tyk analytics£90,000£0£90,000
Security & ComplianceManual audit + basic auth → automated policy enforcement£120,000£25,000£95,000
Infrastructure OverheadSeparate broker infra → consolidated platform£75,000£45,000£30,000
Total Annual Cost£1,415,000£480,000£935,00066% reduction

Net Annual Saving

After accounting for Tyk Enterprise licence costs, Betfred saves £935K annually while gaining capabilities that RabbitMQ cannot provide.

£935K
Annual Saving
£2.8M
3-Year Saving
7 months
Payback Period

Future Solution: What Betfred Will See

End-State Vision

API Gateway Dashboard
API Gateway Dashboard

Real-time operational dashboard showing all 40+ provider integrations, per-provider latency heatmaps, error rates, and throughput metrics. Operators can drill down into individual provider health, view circuit breaker states, and manage rate limiting tiers from a single pane of glass.

Projected Business Impact

315%
3-Year ROI
70%
Faster Provider Onboarding
£2.1M
Annual Cost Savings
99.99%
Gateway Uptime SLA