SKAkash GherWeb Developer & HTML5 Game Specialist
HomeCase StudiesProjectsBlogWritingStudioStoreLabsAbout
All Case Studies

Creative case study

Remote Gaming Server (RGS) Architecture

8 June 2026
Sky
by sky
12 min readRGSiGamingBackendArchitecture

A complete blueprint of an enterprise iGaming backend system: from the Seven-Layer Model and 48ms game transaction loops to GLI compliance and scaling pipelines.

GoKubernetesRedis Cluster
Case
Blogs
Writings
Studio
Labs
Home
Projects
Store
About
Apache Kafka
PostgreSQL
WebSockets

Client

Internal Research & iGaming Infrastructure Reference

Role

Backend Architect

Year

2026

Discipline

System Architecture

Remote Gaming Server (RGS) Architecture
Doodle concept visual

Designed a certified, enterprise-grade RGS supporting 50,000+ concurrent players with a P50 transaction latency under 48ms and a 99.97% uptime SLA.

The hero image is loaded from the MDX coverImage field. Replace the demo URL with your own gameplay capture, PixiJS canvas screenshot, or rendered artwork.

< 48ms

P50 Latency

99.97%

Uptime SLA

50x Spike

Peak Capacity

On this page

  • Executive Summary & Market Context
  • Market Intelligence (2024–2027)
  • RGS Architecture — Seven-Layer Model
  • Architecture Layer Reference
  • Architectural Rationale
  • Why Microservices?
  • Why Redis for Sessions?
  • Why Apache Kafka for Event Streaming?
  • Why a Separate Compliance Database?
  • Transaction Flow — The 48ms Game Round
  • Step-by-Step Breakdown
  • Critical Design Principles
  • Atomic Wallet Operations
  • Idempotency Keys
  • Session Interrupt Recovery
  • RNG Architecture & Certification
  • RNG Types
  • Certification Bodies
  • Regulatory Compliance Frameworks
  • Jurisdiction Requirements Matrix
  • Scaling & Performance Architecture
  • Five-Layer Spike Handling Architecture
  • Build vs License — Business Case Analysis
  • Technology Trends — 2025 to 2027
  • Technical FAQ & Glossary
  • RGS vs Casino Platform vs Game Aggregator
  • Mid-Round Interruption Recovery Sequence

Akash Gher

High-performance web experiences

Case StudiesProjectsStudioStoreLogin

© 2026 Akash Gher. All rights reserved.

Executive Summary & Market Context

A Remote Gaming Server (RGS) is the central nervous system of any regulated iGaming operation. It is not simply a server that hosts games — it is a distributed system of specialised microservices that simultaneously manages game logic execution, Random Number Generation (RNG), transaction processing, player session integrity, regulatory compliance, content distribution to 300+ providers, and real-time analytics across millions of concurrent players.

Without a certified, enterprise-grade RGS, an operator cannot obtain a gambling licence in any major regulated jurisdiction. The RGS is what regulators audit, what testing labs certify, and what ultimately determines latency, uptime, fraud protection, and GGR growth ceiling.

Market Intelligence (2024–2027)

KPI / MetricValue
Global iGaming GGR (2024)$78.7 billion
Projected GGR (2027)$112 billion+
RGS Market Size (2027)$2.5 billion
RGS Market CAGR (2024–2027)12.3%
Mobile as Primary Channel~80% of all sessions
Average Games per Top Aggregator2,400+
Full Game Round Trip (P50)< 48 milliseconds
Achievable Platform Uptime SLA99.97% (< 2.5 hr/yr)
Peak Traffic Spike Capacity50× normal volume
Redis Cache Hit Rate (peak)98%
Kubernetes HPA Scale Time45–90 seconds (cold start)
P99 Latency Target< 80 ms globally

RGS Architecture — Seven-Layer Model

An enterprise RGS is a distributed system of specialised microservices, each responsible for one critical function, all operating in concert at sub-50ms speeds.

Architecture Layer Reference

LayerNameTechnologiesResponsibility
L1Client & DeliveryWebSocket REST API HTML5 SDK iOS AndroidPlayer-facing interface. All game logic stays server-side; client renders visual output only.
L2API Gateway & SecurityKong JWT Auth Rate Limiting WAF Cloudflare DDoSFirst line of defence. Validates tokens, enforces rate limits, terminates SSL, and routes requests.
L3Core Game ServicesRNG Engine Game Logic Session Manager Bonus Engine Odds ServiceHeart of the RGS. Processes bets, invokes RNG, applies math models, tracks session state.
L4Wallet & TransactionsACID Transactions Multi-Currency Crypto Support AML HooksDebits bets and credits wins atomically. Supports fiat, multi-currency, and crypto at the abstraction layer.
L5Cache, Queue & EventsRedis Cluster Apache Kafka RabbitMQ Event StreamingRedis serves sessions in <1 ms; Kafka decouples analytics/compliance from the core game path.
L6Data Persistence & AnalyticsMongoDB PostgreSQL ClickHouse Elasticsearch TimescaleDBImmutable game logs, financial records, high-speed analytics, and regulator-accessible audit data.
L7Cloud Infra & ObservabilityKubernetes Docker AWS/Azure Multi-Region Grafana Prometheus ELKActive-active multi-region deployment for 99.97% uptime SLA. Full observability stack.

Architectural Rationale

Why Microservices?

A monolithic RGS is a single point of failure — if the billing module crashes, all games go down. Microservices isolate each function (RNG, wallet, session). One module can fail, be updated, or scaled independently without touching any other. This architecture is non-negotiable for a 99.97% uptime SLA across regulated markets.

Why Redis for Sessions?

Database queries take 5–20ms each. For a single game round needing 3–5 lookups, that is 75ms before any game logic runs. Redis serves the same data in under 0.5ms from in-memory storage. At 50,000 concurrent sessions, this difference separates a functional platform from an unusable one.

Why Apache Kafka for Event Streaming?

The core game transaction must complete in under 10ms. Analytics, fraud detection, and compliance logging are important but not time-critical. Kafka decouples these: the transaction commits instantly, and downstream processes consume the event stream asynchronously — so they never block a player's game round.

Why a Separate Compliance Database?

UKGC and MGA require game logs to be immutable, tamper-evident, and accessible for independent audit at any time. A separate PostgreSQL instance with write-only access from the game engine (no UPDATE, no DELETE) ensures a forensically sound audit trail — a certification prerequisite in most tier-1 jurisdictions.


Transaction Flow — The 48ms Game Round

A single game round — from the moment a player clicks Spin to the moment the result appears on screen — involves seven distinct technical operations across three infrastructure layers.

Step-by-Step Breakdown

StepTimingOperationTechnologyDetail
10–1 msPlayer Initiates BetWebSocket / TLS 1.3Player clicks Spin. Signed, encrypted bet payload sent over persistent WebSocket. Payload < 2 KB compressed.
21–3 msAPI Gateway Auth & RoutingJWT / Redis / KongJWT validated against Redis session (<0.5 ms). Account checked for limits/suspension. Request routed to Game Logic service.
33–8 msWallet Debit & Balance LockACID Transaction / PostgreSQLBet amount debited atomically before RNG is invoked. Optimistic locking prevents concurrency issues.
48–15 msRNG & Game Logic ExecutionCSPRNG / Math EngineCertified CSPRNG generates random seed. Math engine applies game model (RTP, volatility, bonus triggers). SHA-256 round hash generated.
515–22 msWin Calculation & Wallet CreditACID Credit / Bonus EngineWin amount calculated and wallet credit committed atomically. Jackpot/bonus triggers dispatched asynchronously.
622–30 ms (async)Compliance Logging & Event StreamKafka / Write-only PostgreSQLImmutable round record written (player ID, bet, RNG seed hash, outcome, timestamp). Kafka publishes to analytics/fraud queue.
730–48 ms totalResult Delivered to PlayerWebSocket / CDN EdgeGame result payload returned over WebSocket. Client renders animation. CDN edge serves static assets.

Critical Design Principles

Atomic Wallet Operations

Both the bet debit and win credit are committed in the same ACID database transaction that records the round result. It is therefore impossible for a win to be credited without the corresponding bet being recorded, or for a bet to be deducted without a valid round result being persisted. This design eliminates all double-spending and fund-loss scenarios.

Idempotency Keys

Every bet request carries a unique idempotency key generated client-side. If a network interruption causes the client to retry the same request, the RGS recognises the key and returns the already-computed result rather than processing a duplicate round — preventing any possibility of charging a player twice for the same spin.

Session Interrupt Recovery

Session state is persisted in Redis before the bet is confirmed. If connectivity is lost mid-round:

  1. Player reconnects and client queries the RGS for pending round state via a dedicated session-resume endpoint.
  2. RGS either completes the round (if the outcome was computed) or voids and refunds the bet atomically.
  3. All interruption events are logged to the immutable compliance database with full audit trail.

RNG Architecture & Certification

The Random Number Generator is the most scrutinised component of any RGS. It is the mathematical proof that a game is fair — that outcomes cannot be predicted, manipulated, or biased. Every regulated jurisdiction requires an RGS's RNG to be independently tested and certified before a single game round can go live.

RNG Types

  • CSPRNG (Cryptographically Secure Pseudo-Random Number Generator): The standard for iGaming. Uses a combination of hardware entropy sources and cryptographic algorithms — typically AES-256 in counter mode or ChaCha20 — to produce statistically indistinguishable-from-random output. Re-seeded periodically.
  • HRNG (Hardware Random Number Generator): Physical entropy sources (quantum noise, thermal noise) generate seeds via Hardware Security Modules (HSMs). Highest entropy quality.
  • Blockchain / VRF (Verifiable Random Function): Public blockchain hash chains allow any player to independently verify that any specific game round outcome was not manipulated.

Certification Bodies

Certification BodyReachKey MarketsTesting Scope
GLI — Gaming Laboratories International475+ jurisdictionsUKGC, MGA, AGCO, most major markets41 statistical tests + full source code review. Widest global acceptance.
BMM Testlabs300+ regulatory authoritiesAustralia, Asia-Pacific, EuropeMath model validation, RTP verification, complex system testing.
eCOGRAOngoing (monthly testing)Online-focused, player-trust marketsIssues "Safe and Fair" seal. Continuous compliance rather than one-time certification.
iTech Labs140+ jurisdictionsAPAC, Australia, New ZealandStrong in online poker RNG testing; full statistical and source code testing.

Regulatory Compliance Frameworks

Compliance is not a checkbox. Each regulated jurisdiction has specific, technically-detailed requirements that must be built into RGS architecture from Day 1 — not retrofitted later.

Jurisdiction Requirements Matrix

RegulatorFull NameKey RGS Technical RequirementsTop Mandates
UKGC 🇬🇧UK Gambling CommissionStrictest globally. 5-year immutable log retention, 24-hour audit access. GamStop self-exclusion at wallet level. RTP displayed pre-session. Affordability checks on deposit velocity. GLI or BMM certification mandatory.5-yr logs, GamStop, RTP display, affordability checks, GLI cert
MGA 🇲🇹Malta Gaming AuthorityMost internationally recognised B2B licence. KYC verified before first game round. Real-time transaction reporting to MGA system. Configurable deposit limits, reality checks, cooling-off periods. MGA-approved lab certification required per game.Real-time reporting, pre-bet KYC, reality checks, MGA lab cert
AGCO 🇨🇦Ontario — CanadaData residency: player data on Canadian or US soil. GameSense self-exclusion integration. Bonus metadata transparency requirements. Marketing suppression for registered problem gamblers. High-velocity deposit intervention flows.Canadian data residency, GameSense, bonus transparency
Spelinspektionen 🇸🇪SwedenWeekly deposit limits (default 5,000 SEK/week). Session time tracked and displayed. Mandatory 24-hour break after extended play. Welcome bonuses for casino prohibited; RGS must block non-compliant promotional mechanics.Sweden limits, mandatory breaks, bonus restrictions engine
DGOJ 🇪🇸SpainPre-approval of all game content before activation. Live register of approved games in RGS. AML reporting: single tx > EUR 2K, daily cumulative > EUR 10K. Player identity verified before game loads (not just before deposit).Pre-approved game register, EUR 2K AML, pre-game ID
Curacao eGaming 🇨🇼Offshore / Emerging MarketsMost accessible licence for LATAM, APAC, emerging markets. Basic RNG certification (GLI equivalent), standard KYC/AML, player protection minimums. No data residency requirements.Basic RNG cert, standard KYC/AML, no data residency

Scaling & Performance Architecture

During high-profile sporting events or peak weekend hours, player traffic can spike 50× normal volume in under 60 seconds. An enterprise RGS must absorb this without any degradation.

Five-Layer Spike Handling Architecture

  1. CDN Edge Layer (Cloudflare / CloudFront): Serves static assets (60–80% of all HTTP requests) instantly. DDoS validation separates legitimate spike from attack traffic.
  2. Redis Cache Layer: 98% of session lookups served from memory, preventing SQL database collapse.
  3. Kubernetes HPA (Horizontal Pod Autoscaler): Monitors CPU and WebSocket connection count. Pre-scale 30 min before known events to eliminate cold-start window.
  4. Kafka Event Queue: Decouples compliance logging and analytics from core transactions. Core transaction completes immediately; downstream consumers process asynchronously.
  5. DB Read Replicas: Read queries (balance lookups, game config, bonus eligibility) route to replicas. Primary database handles writes only.

Build vs License — Business Case Analysis

Every operator faces the decision of whether to license a pre-built RGS or build a custom solution.

  • Licensed RGS: 4-8 weeks time to market, low upfront cost, but heavy royalty drain (typically 8% of Gross Gaming Revenue in perpetuity). Highly restrictive for custom game mechanics and expansions.
  • Custom RGS: 12-18 months build time (or 6-8 weeks with white-label), higher upfront team + infra costs, but 100% IP ownership, no royalties, and complete freedom to expand to new jurisdictions and create custom mechanics.
  • Valuation Impact: Operators with proprietary, certified RGS infrastructure are consistently valued 3–5× higher in M&A transactions.

Technology Trends — 2025 to 2027

  • AI-Powered RNG Auditing: ML models analyse RNG output for statistical drift in real time.
  • Edge-Native RGS Deployment: Lightweight game logic containers at CDN edge (Cloudflare Workers, AWS Lambda@Edge) cut round-trip time (RTT) from 180–300ms to <30ms.
  • Unified Casino + Sportsbook RGS: Single player wallet, session, and compliance layer across slots, live casino, and sports betting.
  • Blockchain Provably Fair at Scale: Off-chain computation with on-chain commitment schemes achieve sub-100ms settlement finality for interactive rounds.

Technical FAQ & Glossary

RGS vs Casino Platform vs Game Aggregator

  • Casino Platform: Front-end player experience (lobby, registration, cashier, CRM, promotions). Does not run game logic.
  • RGS: Backend system that actually runs games (RNG, game logic, transactions, compliance logging). Called by Casino Platform via API.
  • Game Aggregator: A special type of RGS that connects to multiple other RGS providers and exposes all their games to operators via a single API.

Mid-Round Interruption Recovery Sequence

  1. Session state is persisted in Redis before the bet is confirmed — the bet amount is protected.
  2. Idempotency keys prevent the same round from being processed twice if the client retries after reconnection.
  3. On reconnect, the client queries the RGS for pending round state via a dedicated session-resume endpoint.
  4. The RGS either completes the round (if the outcome was computed) or voids and refunds the bet atomically.
  5. All interruption events are logged to the immutable compliance database with full audit trail.

More Case Studies

You might also like

View all
iGaming Math Config Architecture
9 June 2026

iGaming Math Config Architecture

A technical deep-dive into how production iGaming studios store, version, and serve complex game math configurations across operators, jurisdictions, and variants.

Lish Programming Language
6 June 2026

Lish Programming Language

An educational compiler project translating academic Computer Science theory into a working plain-English general-purpose compiler that compiles directly to zero-overhead x64 assembly.

Sky AI Portfolio v2.0
16 May 2026

Sky AI Portfolio v2.0

A cinematic, AI-driven 'Command Center' featuring intelligent site control, predictive autocomplete, and hardware-accelerated animations built with Next.js 15.