Ruby & Erlang: at Scale with Style
summary
Wooga runs social games at ~50M monthly users and ~14 billion API calls a month and moves from stateless web servers to stateful Erlang session-per-user processes that keep game state in memory, serialize to S3 on timeout, and use the actor mailbox for strong single-writer concurrency. A hybrid ZeroMQ/Mongrel2 Ruby workers prototype sends state plus operation to Ruby but hits a ~10x throughput drop and bandwidth limits at ~300 MB/s, ports improve latency but cost operability, so the team chooses pure Erlang for scalability and reliability.
AI-written summary · about
chapters (26)
- 0:00Intro
- 1:19Typical game architecture
- 3:05The scale is interesting
- 4:38Wooga's approach to development
- 6:34Existing backends - Technology landscape
- 7:44Most games use stateless application servers
- 8:48And then there's sharding
- 9:13Find the flaw
- 9:34Strong session pattern
- 10:52Stateful game server
- 12:10The DB is no longer the bottleneck
- 12:36Magic Land uses Erlang
- 14:13Erlang & Ruby
- 16:04Bringing two worlds together
- 17:24Do you know Mongrel2?
- 19:19Connecting the dots
- 21:10Example controller in Ruby
- 22:33Example model in Ruby
- 23:49Game state
- 24:43Looking back at the game action
- 28:02Performance impact for large payloads
- 29:41NOT CPU bound
- 30:31This has happened before
- 34:49Example model in Erlang
- 35:36CAN THERE BE HAPPINESS
- 41:15Example controller in Erlang
related talks
01h 03mRuby at Scale
46mScaling With Friends
35mRuby on Rails is a Game Engine
56mScaling Rails API to Write-Heavy Traffic
38mHigh Concurrent Ruby Web Development Without Fear
27mScaling a Rails Monolith w/Event Driven Microservices
31mHigh performance APIs in Ruby using ActiveRecord and Goliath
34mShared Nothing Architecture - How to Scale to Infinity
