Games for the Masses (QCon London 2012)

145
GAMES FOR THE MASSES How DevOps Affects Architecture Jesper RichterReichhelm, @jrirei Wednesday, March 7, 2012

description

Building a backend for a successful social game is always challenging: It needs to service over 1 million users per day that generate 10.000 http requests per second or more whereas the vast majority of those requests are changing persistent state. Using a conventional technology stack that leads to over 50,000 database writes per second. Throughout the last two years half a dozen teams at Wooga have set out to build a backends for social games, each trying to improve on previous solutions. Each team was able to leverage experiences made by other teams but was free to choose their own technology stack and hosting environment. They also operated the game themselves in a DevOps way. This talk will trace back that evolution of backends: Starting out with a simple LAMP stack, first replacing PHP by Ruby, then replacing relational by NoSQL databases and ending up in maintaining stateful application servers utilizing Erlang OTP - and more. We will discuss limitations and problems we faced in live operation and show how later teams improved on the overall design.

Transcript of Games for the Masses (QCon London 2012)

Page 1: Games for the Masses (QCon London 2012)

GAMES  FOR  THE  MASSESHow  DevOps  Affects  Architecture

Jesper  Richter-­‐Reichhelm,  @jrireiWednesday, March 7, 2012

Page 2: Games for the Masses (QCon London 2012)

Wednesday, March 7, 2012

Page 3: Games for the Masses (QCon London 2012)

Our  games  all  look  the  same

Flash  client Backend

Wednesday, March 7, 2012

Page 4: Games for the Masses (QCon London 2012)

Our  games  all  look  the  same

Flash  client

Game  Session

Asynch.  CommunicaEon

Wednesday, March 7, 2012

Page 5: Games for the Masses (QCon London 2012)

Our  games  all  look  the  same

State  Changes

ValidaEon

Persistence

Backend

Wednesday, March 7, 2012

Page 6: Games for the Masses (QCon London 2012)

But  the  scale  is  interesEng

14  billion  requests  /  month

Wednesday, March 7, 2012

Page 7: Games for the Masses (QCon London 2012)

But  the  scale  is  interesEng

14  billion  requests  /  month

Wednesday, March 7, 2012

Page 8: Games for the Masses (QCon London 2012)

But  the  scale  is  interesEng

14  billion  requests  /  month

>100,000  DB  operaEons  /  second

Wednesday, March 7, 2012

Page 9: Games for the Masses (QCon London 2012)

But  the  scale  is  interesEng

14  billion  requests  /  month

>100,000  DB  operaEons  /  second

>50,000  DB  updates  /  second

Wednesday, March 7, 2012

Page 10: Games for the Masses (QCon London 2012)

2  Developers  to  do  it  all

Typical  team  setup

4  product  managers4  ar0sts4  frontend  engineers2  backend  engineers-­‐ design,  implementa6on,  opera6on

Wednesday, March 7, 2012

Page 11: Games for the Masses (QCon London 2012)

Wooga  has  dedicated  game  teams

Wednesday, March 7, 2012

Page 12: Games for the Masses (QCon London 2012)

Wednesday, March 7, 2012

Page 13: Games for the Masses (QCon London 2012)

Wednesday, March 7, 2012

Page 14: Games for the Masses (QCon London 2012)

Oct  2009

Wednesday, March 7, 2012

Page 15: Games for the Masses (QCon London 2012)

Oct  2009 Jan  2010

Wednesday, March 7, 2012

Page 16: Games for the Masses (QCon London 2012)

Oct  2009 Jan  2010

Oct  2010

Wednesday, March 7, 2012

Page 17: Games for the Masses (QCon London 2012)

Oct  2009 Jan  2010

Oct  2010 Aug  2012

Wednesday, March 7, 2012

Page 18: Games for the Masses (QCon London 2012)

Architecture  EvoluEon  at  Wooga

The  Start

The  Next  Step

Best  of  Two  Worlds

Company  Values

Wednesday, March 7, 2012

Page 19: Games for the Masses (QCon London 2012)

Oct  2009:  1st  team  wanted  good  code  quality

Good  code  quality

Easy  to  understandEasy  to  testEasy  to  refactor

Wednesday, March 7, 2012

Page 20: Games for the Masses (QCon London 2012)

Oct  2009:  1st  team  wanted  good  code  quality

Good  code  quality

Easy  to  understandEasy  to  testEasy  to  refactor

Wednesday, March 7, 2012

Page 21: Games for the Masses (QCon London 2012)

EvoluEon  I:  Use  Ruby  (on  Rails)

Oct  2009

Wednesday, March 7, 2012

Page 22: Games for the Masses (QCon London 2012)

A  basic  setup  using  sharding  worked  fine

app app app app app app app app app

lb

MySQL

MySQL

slave slave

Wednesday, March 7, 2012

Page 23: Games for the Masses (QCon London 2012)

250K  daily  users

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Life  was  good

Wednesday, March 7, 2012

Page 24: Games for the Masses (QCon London 2012)

250K  daily  users

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Life  was  good NO  MORE

Wednesday, March 7, 2012

Page 25: Games for the Masses (QCon London 2012)

Welcome  to  6  weeks  of  pain!

Heavy  opEmizaEons  were  necessary

Wednesday, March 7, 2012

Page 26: Games for the Masses (QCon London 2012)

Welcome  to  6  weeks  of  pain!

Heavy  opEmizaEons  were  necessary

Numerous  small  fixes  regarding  DB  config

Wednesday, March 7, 2012

Page 27: Games for the Masses (QCon London 2012)

Welcome  to  6  weeks  of  pain!

Heavy  opEmizaEons  were  necessary

Numerous  small  fixes  regarding  DB  configMore  shards

Wednesday, March 7, 2012

Page 28: Games for the Masses (QCon London 2012)

Welcome  to  6  weeks  of  pain!

Heavy  opEmizaEons  were  necessary

Numerous  small  fixes  regarding  DB  configMore  shardsEven  more  shards

Wednesday, March 7, 2012

Page 29: Games for the Masses (QCon London 2012)

Welcome  to  6  weeks  of  pain!

Heavy  opEmizaEons  were  necessary

Numerous  small  fixes  regarding  DB  configMore  shardsEven  more  shardsSpliBng  the  model  to  get  more  shards

Wednesday, March 7, 2012

Page 30: Games for the Masses (QCon London 2012)

Early  sharding  hell:  8  master  and  8  slaves

app app app app appapp app

app app app app app app app app app

appapp

lb

MySQL

MySQL

MySQL

MySQL

MySQL

MySQL

MySQL

MySQL

slave slave slave slaveslave slave slave slave

Wednesday, March 7, 2012

Page 31: Games for the Masses (QCon London 2012)

At  500K  daily  users  we  were  at  a  dead  end

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Wednesday, March 7, 2012

Page 32: Games for the Masses (QCon London 2012)

OUCH!

http://www.flickr.com/photos/billue_the_bear/

Wednesday, March 7, 2012

Page 33: Games for the Masses (QCon London 2012)

Don’t  break  the  bank

Make  it  fasterMake  it  cheaperMake  it  simpler

Jan  2010:  Meanwhile  at  the  2nd  team

Wednesday, March 7, 2012

Page 34: Games for the Masses (QCon London 2012)

Don’t  break  the  bank

Make  it  fasterMake  it  cheaperMake  it  simpler

Jan  2010:  Meanwhile  at  the  2nd  team

Wednesday, March 7, 2012

Page 35: Games for the Masses (QCon London 2012)

EvoluEon  II:  Use  Redis  as  main  database

Oct  2009

Jan  2010

Wednesday, March 7, 2012

Page 36: Games for the Masses (QCon London 2012)

If  MySQL  is  a  truck

Fast  enough

Disk  based

Robust

Fast  enough                    disk  based                    robust

Wednesday, March 7, 2012

Page 37: Games for the Masses (QCon London 2012)

If  MySQL  is  a  truck,  Redis  is  a  race  car

Super  fast

RAM  based

Fragile

Super  fast                    RAM  based                    fragile

Wednesday, March 7, 2012

Page 38: Games for the Masses (QCon London 2012)

Bare  metal  for  low  latency!

app app app

lb

Re-­‐dis

Re-­‐dis

disk(S3)

app appapp app

Wednesday, March 7, 2012

Page 39: Games for the Masses (QCon London 2012)

How  could  we  apply  that  knowledge?

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Wednesday, March 7, 2012

Page 40: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 41: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 42: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 43: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 44: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 45: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 46: Games for the Masses (QCon London 2012)

On-­‐demand  migraEons  from  MySQL  to  Redis

Wednesday, March 7, 2012

Page 47: Games for the Masses (QCon London 2012)

Typical  migraEon  throughput  over  3  days

Wednesday, March 7, 2012

Page 48: Games for the Masses (QCon London 2012)

Big  and  staEc  data  in  MySQL,  rest  goes  to  Redis

60  GB  data

50%  writes

256  GB  data

10%  writeshCp://www.flickr.com/photos/erix/245657047/

Wednesday, March 7, 2012

Page 49: Games for the Masses (QCon London 2012)

One  team  saved  the  other  one

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Wednesday, March 7, 2012

Page 50: Games for the Masses (QCon London 2012)

One  team  saved  the  other  one

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Wednesday, March 7, 2012

Page 51: Games for the Masses (QCon London 2012)

We  now  have  more  than  2  million  users  /  day

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

Wednesday, March 7, 2012

Page 52: Games for the Masses (QCon London 2012)

We  now  have  more  than  2  million  users  /  day

!"

#!!$!!!"

%$!!!$!!!"

%$#!!$!!!"

&$!!!$!!!"

'()*%!" +,-*%!" ./0*%!" +12*%%" '()*%%" +,-*%%" ./0*%%"

AWS  outagein  Ireland

Wednesday, March 7, 2012

Page 53: Games for the Masses (QCon London 2012)

10  single-­‐points-­‐of-­‐failure  -­‐  no  fun  at  all!

app app app app app app app app app app app appapp

app app app app app app app app app app app appapp

app app app app app app app app app app app appapp

lb lb

redis redis redis redis redisMySQL

MySQL

MySQL

MySQL

MySQL

slave slave slave slave slaveslave slave slave slave slave

Wednesday, March 7, 2012

Page 54: Games for the Masses (QCon London 2012)

OUCH!

http://www.flickr.com/photos/wolfsavard/

Wednesday, March 7, 2012

Page 55: Games for the Masses (QCon London 2012)

Architecture  EvoluEon  at  Wooga

The  Start:  Ruby

The  Next  Step

Best  of  Two  Worlds

Company  Values

Wednesday, March 7, 2012

Page 56: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 57: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 58: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 59: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 60: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 61: Games for the Masses (QCon London 2012)

Stateless  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 62: Games for the Masses (QCon London 2012)

Stateful  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 63: Games for the Masses (QCon London 2012)

Stateful  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 64: Games for the Masses (QCon London 2012)

Stateful  servers  and  DBs

Server Database

Wednesday, March 7, 2012

Page 65: Games for the Masses (QCon London 2012)

Stateful  servers  and  DBs

Server Database

One  Game  Session

Wednesday, March 7, 2012

Page 66: Games for the Masses (QCon London 2012)

Stateful  servers  and  DBs

Server Database

One  Game  Session

Wednesday, March 7, 2012

Page 67: Games for the Masses (QCon London 2012)

Oct  2010:  3rd  team  used  a  stateful  server

If  DBs  are  the  problem

Don’t  use  themStore  state  in  serverNeed  to  be  robust

Wednesday, March 7, 2012

Page 68: Games for the Masses (QCon London 2012)

Oct  2010:  3rd  team  used  a  stateful  server

If  DBs  are  the  problem

Don’t  use  themStore  state  in  serverNeed  to  be  robust

Wednesday, March 7, 2012

Page 69: Games for the Masses (QCon London 2012)

EvoluEon  III:  Use  Erlang  for  a  stateful  server

Oct  2009

Jan  2010

Oct  2010

Wednesday, March 7, 2012

Page 70: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

session

Wednesday, March 7, 2012

Page 71: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

sessionsessionsessionsession

Wednesday, March 7, 2012

Page 72: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

Wednesday, March 7, 2012

Page 73: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 74: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 75: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 76: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 77: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 78: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 79: Games for the Masses (QCon London 2012)

Stateful  servers  are  not  as  hard  as  you  think

Server

sessionsessionsessionsession

Server

sessionsessionsessionsession

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 80: Games for the Masses (QCon London 2012)

With  stateful  server  the  DB  is  less  used

0

7,500

15,000

22,500

30,000

database  operations  /  sec

Ruby  Stateless Erlang  Stateful

Wednesday, March 7, 2012

Page 81: Games for the Masses (QCon London 2012)

With  stateful  server  the  DB  is  less  used

0

7,500

15,000

22,500

30,000

database  operations  /  sec

Ruby  Stateless Erlang  Stateful

700

Wednesday, March 7, 2012

Page 82: Games for the Masses (QCon London 2012)

Deploying  with  a  stateful  server

In  order  to  bring  up  a  new  version

Wednesday, March 7, 2012

Page 83: Games for the Masses (QCon London 2012)

Deploying  with  a  stateful  server

In  order  to  bring  up  a  new  version

Just  deploy  it

Hot  code  replacement  is  great!

Wednesday, March 7, 2012

Page 84: Games for the Masses (QCon London 2012)

There  are  even  more  advantages

Faster  than  Ruby  (5,000  rps  /  node)-­‐ CPU  bound

Wednesday, March 7, 2012

Page 85: Games for the Masses (QCon London 2012)

There  are  even  more  advantages

Faster  than  Ruby  (5,000  rps  /  node)-­‐ CPU  bound

Very  few  SPOFs-­‐ ...  and  those  are  easy  to  recover

Wednesday, March 7, 2012

Page 86: Games for the Masses (QCon London 2012)

There  are  even  more  advantages

Faster  than  Ruby  (5,000  rps  /  node)-­‐ CPU  bound

Very  few  SPOFs-­‐ ...  and  those  are  easy  to  recover

TransacEonal  logic-­‐ Invariants  instead  of  explicit  error  handling

Wednesday, March 7, 2012

Page 87: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Wednesday, March 7, 2012

Page 88: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Wednesday, March 7, 2012

Page 89: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Wednesday, March 7, 2012

Page 90: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Wednesday, March 7, 2012

Page 91: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Central  handling  of  effects

Wednesday, March 7, 2012

Page 92: Games for the Masses (QCon London 2012)

Example  “controller”  in  Erlang

Central  handling  of  effects

TransacEonal  behavior

Wednesday, March 7, 2012

Page 93: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Wednesday, March 7, 2012

Page 94: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Wednesday, March 7, 2012

Page 95: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Wednesday, March 7, 2012

Page 96: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Wednesday, March 7, 2012

Page 97: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Wednesday, March 7, 2012

Page 98: Games for the Masses (QCon London 2012)

Example  model  in  Erlang

Erlang  code  is  not  that  hard  to  read,  isn’t  it?

Wednesday, March 7, 2012

Page 99: Games for the Masses (QCon London 2012)

http://www.flickr.com/photos/hotreactor/

Wednesday, March 7, 2012

Page 100: Games for the Masses (QCon London 2012)

Architecture  EvoluEon  at  Wooga

The  Start:  Ruby

The  Next  Step:  Erlang

Best  of  Two  Worlds

Company  Values

Wednesday, March 7, 2012

Page 101: Games for the Masses (QCon London 2012)

Aug  2011:  4th  team  wanted  both

Erlang  is  great

Concurrency,  robustnessGreat  for  opera0on

Wednesday, March 7, 2012

Page 102: Games for the Masses (QCon London 2012)

Aug  2011:  4th  team  wanted  both

Erlang  is  great

Concurrency,  robustnessGreat  for  opera0on

Ruby  is  great

Concise,  expressive,  testableGreat  for  development

Wednesday, March 7, 2012

Page 103: Games for the Masses (QCon London 2012)

Aug  2011:  4th  team  wanted  both

Erlang  is  great

Concurrency,  robustnessGreat  for  opera0on

Ruby  is  great

Concise,  expressive,  testableGreat  for  development

Wednesday, March 7, 2012

Page 104: Games for the Masses (QCon London 2012)

Aug  2011:  4th  team  wanted  both

Erlang  is  great

Concurrency,  robustnessGreat  for  opera0on

Ruby  is  great

Concise,  expressive,  testableGreat  for  development

Wednesday, March 7, 2012

Page 105: Games for the Masses (QCon London 2012)

EvoluEon  IV:  The  best  out  of  two  worlds

Oct  2009

Jan  2010

Oct  2010

Aug  2011

Wednesday, March 7, 2012

Page 106: Games for the Masses (QCon London 2012)

The  basic  setup  looks  exactly  like  before

Server

sessionsessionsessionsession

Server

sessionsessionsessionsession

Server

sessionsessionsessionsession

S3

Wednesday, March 7, 2012

Page 107: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

Wednesday, March 7, 2012

Page 108: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

Wednesday, March 7, 2012

Page 109: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

Wednesday, March 7, 2012

Page 110: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

Wednesday, March 7, 2012

Page 111: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

DSL-­‐like  definiEon  of  game  acEon

Wednesday, March 7, 2012

Page 112: Games for the Masses (QCon London 2012)

Example  controller  in  Ruby

DSL-­‐like  definiEon  of  game  acEon

Skinny  as  controllers  should  be

Wednesday, March 7, 2012

Page 113: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Wednesday, March 7, 2012

Page 114: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Wednesday, March 7, 2012

Page 115: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Wednesday, March 7, 2012

Page 116: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Wednesday, March 7, 2012

Page 117: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Easily  unit  testable

Wednesday, March 7, 2012

Page 118: Games for the Masses (QCon London 2012)

Example  model  in  Ruby

Easily  unit  testable

Minimal  amount  of  code

Wednesday, March 7, 2012

Page 119: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

Wednesday, March 7, 2012

Page 120: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

sender

Wednesday, March 7, 2012

Page 121: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

Worker

Worker

Worker

Worker

Worker

sender

Wednesday, March 7, 2012

Page 122: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

receiver

Worker

Worker

Worker

Worker

Worker

sender

Wednesday, March 7, 2012

Page 123: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

receiver

Worker

Worker

Worker

Worker

Worker

sender

Wednesday, March 7, 2012

Page 124: Games for the Masses (QCon London 2012)

Bringing  2  worlds  together

Server

session

session

...

session

receiver

Worker

Worker

Worker

Worker

Worker

sender

Wednesday, March 7, 2012

Page 125: Games for the Masses (QCon London 2012)

Game  state

Game  state  is  split  in  mulEple  parts

user,  map,  fruit_trees  etc.

Wednesday, March 7, 2012

Page 126: Games for the Masses (QCon London 2012)

Game  state

Game  state  is  split  in  mulEple  parts

user,  map,  fruit_trees  etc.

Erlang  does  not  care  about  content

Serialized  Ruby  objects

Wednesday, March 7, 2012

Page 127: Games for the Masses (QCon London 2012)

Game  state

Game  state  is  split  in  mulEple  parts

user,  map,  fruit_trees  etc.

Erlang  does  not  care  about  content

Serialized  Ruby  objects

Erlang  does  know  mapping  of  state  parts  to  URLs

Mapping  provided  by  Ruby  on  startup

Wednesday, March 7, 2012

Page 128: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Wednesday, March 7, 2012

Page 129: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Wednesday, March 7, 2012

Page 130: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Mapping  of  state  parts  to  game  acEons

Wednesday, March 7, 2012

Page 131: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Mapping  of  state  parts  to  game  acEonsWorker  knows  mapping

Wednesday, March 7, 2012

Page 132: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Mapping  of  state  parts  to  game  acEonsWorker  knows  mappingWorker  pushes  mapping  to  Erlang  on  startup

Wednesday, March 7, 2012

Page 133: Games for the Masses (QCon London 2012)

Looking  back  at  the  game  acEon

Mapping  of  state  parts  to  game  acEonsWorker  knows  mappingWorker  pushes  mapping  to  Erlang  on  startupErlang  can  query  mapping  if  needed

Wednesday, March 7, 2012

Page 134: Games for the Masses (QCon London 2012)

NICE!

http://www.flickr.com/photos/aigle_dore/

Wednesday, March 7, 2012

Page 135: Games for the Masses (QCon London 2012)

Architecture  EvoluEon  at  Wooga

The  Start:  Ruby

The  Next  Step:  Erlang

Best  of  Two  Worlds

Company  Values

Wednesday, March 7, 2012

Page 136: Games for the Masses (QCon London 2012)

Each  new  game  brought  us  innovaEon

Oct  2009

Jan  2010

Oct  2010

Aug  2011

Wednesday, March 7, 2012

Page 137: Games for the Masses (QCon London 2012)

Small teams

overbig teams

We’ve  learned  to    value

Wednesday, March 7, 2012

Page 138: Games for the Masses (QCon London 2012)

Collaboration

overcompetition

We’ve  learned  to    value

Wednesday, March 7, 2012

Page 139: Games for the Masses (QCon London 2012)

Generalists

overspecialists

We’ve  learned  to    value

Wednesday, March 7, 2012

Page 140: Games for the Masses (QCon London 2012)

Effort reduction

overcost reduction

We’ve  learned  to    value

Wednesday, March 7, 2012

Page 141: Games for the Masses (QCon London 2012)

Innovation

overrisk mitigation

We’ve  learned  to    value

Wednesday, March 7, 2012

Page 142: Games for the Masses (QCon London 2012)

A  good  value  system

We’ve  learned  to  value

Small  teams                              over  

CollaboraEon                        over

Generalists                                over

Effort  reducEon                over

InnovaEon                                  over

Big  teams  

Compe00on

Specialists

Cost  reduc0on

Risk  mi0ga0on

Wednesday, March 7, 2012

Page 143: Games for the Masses (QCon London 2012)

It works!

Wednesday, March 7, 2012

Page 144: Games for the Masses (QCon London 2012)

It works!

Be fast, be bold!

Wednesday, March 7, 2012

Page 145: Games for the Masses (QCon London 2012)

QuesEons?

Jesper  Richter-­‐Reichhelm@jrirei

slideshare.net/woogawooga.com/jobs

Wednesday, March 7, 2012