Case study · Online game

Real-time backend at 3.7M concurrent users and bots

I built the real-time backend for an online game that held 3.7M concurrent users and bots and served 43M to 80M requests a day.

  • 3.7Mconcurrent users and bots
  • 43M to 80Mrequests a day
  • < 85msp99 latency
  • 99.97%uptime

Challenge

Launch and event surges, bot swarms, and session servers falling over under load.

What I built

A stateless WebSocket gateway, sharded matchmaking, Redis Cluster session state, a Kafka telemetry stream, and bot scoring at the edge.

Stack

Go, Kubernetes (EKS), Redis Cluster, Kafka, ScyllaDB, CloudFront, Prometheus/Grafana, k6.

System design

Any gateway can serve any playerWebSocketsgame eventsaccounts scored as botsthrottledPlayersNetwork Load BalancerStateless Go gatewaysRedis Clustersession state keyed byplayerMatchmaking queuessharded by region and skillbandKafkaScyllaDBhistory and analyticsStream jobscores each connection'sbehaviourAWS WAF

Players connect over WebSockets through a Network Load Balancer to stateless Go gateways, and session state lives in Redis Cluster keyed by player, so any gateway can serve any player. Matchmaking queues are sharded by region and skill band. Game events stream through Kafka into ScyllaDB for history and analytics. A stream job scores each connection's behaviour (timing, input patterns, request rates), and accounts scored as bots are throttled at the gateway and at AWS WAF.

Results

  • 3.7M concurrent
  • 43M to 80M requests a day
  • p99 under 85ms
  • 99.97% uptime
  • 31% of traffic identified as bots and blocked
Back to Work & Research