40
Technical Challenges of Developing a Facebook Game webilea Basel, 26-01-2011

Technical Challenges of Developing a Facebook Game

Embed Size (px)

DESCRIPTION

Talk given at http://webilea.ch/

Citation preview

Page 1: Technical Challenges of Developing a Facebook Game

Technical Challenges of Developing a Facebook

Game

webilea Basel, 26-01-2011

Page 2: Technical Challenges of Developing a Facebook Game

Who?

• Patrick Hüsler / @phuesler

• huesler-informatik.ch

• Freelance developer

• backend developer at ....

Page 4: Technical Challenges of Developing a Facebook Game

Players in Facebook Game Market

Page 5: Technical Challenges of Developing a Facebook Game

Game Developers• Zynga (54 games)

• EA (35 games)

• Pop Cap (2 games)

• Crowd Star (20 games)

• Digital Chocolate (13 games)

• Playdom (39 games)

Page 6: Technical Challenges of Developing a Facebook Game

Anatomy of a Facebook game

Page 7: Technical Challenges of Developing a Facebook Game

Sandbox

• iframe inside Facebook

• flash client (javascript based games are still a minority)

• backend

• Facebook API (FBML, graph, connect, payment ...)

Page 8: Technical Challenges of Developing a Facebook Game

Facebook Game Lingo

Page 9: Technical Challenges of Developing a Facebook Game

Monthly Active Users(MAU)

Page 10: Technical Challenges of Developing a Facebook Game

Current MAU Leader

Page 11: Technical Challenges of Developing a Facebook Game

City Ville~ 100 Million MAU

Page 12: Technical Challenges of Developing a Facebook Game

Daily Active Users(DAU)

Page 13: Technical Challenges of Developing a Facebook Game

Current DAU Leader

Page 14: Technical Challenges of Developing a Facebook Game

City Ville~ 20 Million DAU

Page 15: Technical Challenges of Developing a Facebook Game

checkhttp://appdata.com

Page 16: Technical Challenges of Developing a Facebook Game

Challenges

Page 17: Technical Challenges of Developing a Facebook Game

Goal:~ 1’000’000 DAU

Page 18: Technical Challenges of Developing a Facebook Game

2 People for:

Page 19: Technical Challenges of Developing a Facebook Game

Backend Development

Page 20: Technical Challenges of Developing a Facebook Game

Operations

Page 21: Technical Challenges of Developing a Facebook Game

24/7

Page 22: Technical Challenges of Developing a Facebook Game

Cent/DAU(should be low)

Page 23: Technical Challenges of Developing a Facebook Game

Rapid Growth

Page 24: Technical Challenges of Developing a Facebook Game

Ever changing Facebook APIs

Page 25: Technical Challenges of Developing a Facebook Game

Roughly estimated requirements

• ~ 20’000 concurrent users

• ~ 4’000 rps

• ~ 60’000 DB queries/s

• DB write heavy ~ 50/50

• Deliver plenty of assets (flash files, images etc.)

Page 26: Technical Challenges of Developing a Facebook Game

Our Architecture

Page 27: Technical Challenges of Developing a Facebook Game

Status Quo (Peak)

• ~ 200’000 DAU

• ~ 3’000 concurrent users

• ~ 660 rps peak traffic

• ~ 7000 DB queries/s

• 15 ms average response time

Page 28: Technical Challenges of Developing a Facebook Game

Dedicated hardware

• small number of machines

• fast CPU’s

• fast disks

• fast network

Page 29: Technical Challenges of Developing a Facebook Game

Automate, automate,

automate!!!!!!!

Page 30: Technical Challenges of Developing a Facebook Game

Monitoring

• Availability monitoring with pingdom (pingdom.com)

• Scout for hardware metrics and usage data (scoutapp.com)

• New Relic for applications (newrelic.com)

Page 31: Technical Challenges of Developing a Facebook Game

CDN to deliver assets

Page 32: Technical Challenges of Developing a Facebook Game

Rails Application

Page 33: Technical Challenges of Developing a Facebook Game

Yes, really!

Page 34: Technical Challenges of Developing a Facebook Game

Database: Redis

• very fast

• powerful data structures

• good fit to store different types of data

• supports virtual memory

Page 35: Technical Challenges of Developing a Facebook Game

Data format

• One Redis hash table per user

• Keys store JSON

• Custom built data mapper called Remodel

Page 36: Technical Challenges of Developing a Facebook Game

Durability: Flat files

• Asynchronously written to disk

• Replicated on file system

Page 37: Technical Challenges of Developing a Facebook Game

Q & A

Page 38: Technical Challenges of Developing a Facebook Game

Links

•wooga.com/jobs

•newrelic.com

•scoutapp.com

•pingdom.com

•huesler-informatik.ch

Page 39: Technical Challenges of Developing a Facebook Game

One last thing

Page 40: Technical Challenges of Developing a Facebook Game

euruko2011.org