
Thairath Livescore (Realtime API)
This system is designed as a scalable real-time data infrastructure, aggregating data from external providers and distributing updates to thousands of concurrent users with minimal latency.
Tech Stack

This system is designed as a scalable real-time data infrastructure, aggregating data from external providers and distributing updates to thousands of concurrent users with minimal latency.
Tech Stack
⚽ Thairath LiveScore – Real-Time API Gateway System
Developed a
high-performance real-time API gatewaypowering live football data, delivering instant updates on scores, lineups, match events, and statistics across multiple leagues.
This system is designed as a
scalable real-time data infrastructure, aggregating data from external providers and distributing updates to thousands of concurrent users with minimal latency.
Key goals:
Handle
high concurrency during live matchesDeliver
low-latency, bandwidth-efficient updatesProvide
fine-grained subscription-based data streamingIt acts as a
general-purpose real-time gateway, not limited to sports.
External partner APIs →
data scraping every 15 seconds(rate-limited)
Data processed and published into
Redis Pub/SubMessages encoded using
MessagePack (compressed binary format)Distributed to gateway pods → decompressed → streamed to clients via SSE
Each pod:
~
0.5 CPU (500m)+
512MB RAMHandles ~
6,000+ concurrent SSE connections per pod👉 In Kubernetes,
(1000m = 1 core)
:
Scale pods horizontally based on traffic
Maintain stable performance under heavy load
Lightweight, persistent connection for pushing live updates
Optimized for high concurrency
Reduces payload size significantly vs JSON
Improves throughput and latency
Decouples ingestion from delivery
Enables multi-node horizontal scaling
Clients receive
only changed dataReduces unnecessary bandwidth usage
Clients send current version → receive only diffs
Ensures efficient state synchronization
Fine-grained topics like:
Supports patterns:
Sent every
15–30 secondsKeeps connection alive + detects disconnects
On first connect:
Sends latest full state
Aligns user with current system version
Dynamic channel creation
Flexible routing between publishers and subscribers
Node.js (Realtime API Gateway)
Redis (Pub/Sub)
SSE (Server-Sent Events)
MessagePack
Kubernetes (auto-scaling pods)
Designed and built the
entire real-time gateway architectureImplemented
data ingestion pipeline (15s scraping from partner APIs)Built
Redis-based pub/sub messaging systemDesigned
MessagePack encoding/decoding pipelineDeveloped
SSE streaming layer for real-time deliveryImplemented advanced features:
Delta updates (auto compare)
Version-based syncing
Channel subscription system (with wildcard support)
Heartbeat & connection management
Deployed and optimized system on
Kubernetes with horizontal scalingSupports
multi-source ingestion (multiple providers)Can serve
multiple client types(web, mobile, third-party APIs)
Designed as a
reusable real-time infrastructure platformDelivered
low-latency real-time experienceat scale
Reduced bandwidth via
delta updates + MessagePack compressionAchieved
high concurrency (~6,000+ users per pod)Built a
reusable real-time system for future products1500m CPU = 0.5 CPU core
1sport-livescore/{matchId}
1sport-livescore/*