NoSQL Games_NoSQL Roadshow Berlin

Preview:

Citation preview

gamesNoSQL

Patrick Hueslertwitter: @phuesler

github: phuesler

GamesHow to build

Game backend

iOS

Flash

Facebook

Android

scale

for Diamond Dash~28,000,000monthly active users

15/04/2013

for Diamond Dash~4,600,000daily active users

15/04/2013

engineering

DEVOPSYou can call it

You Build it YOU RUN IT

Developerfriendly

Operationsfriendly

of architectureEVOLUTION

Wooga’s

PrototypeIt starts with a

Admin interface

Add an

Simple Backend Services

GamesPast

learning1st

Game backendReporting

iOS

Flash

Facebook

Android

Game backend

iOS

Flash

Facebook

Android

Reporting

GAme 1

Game 2Reporting

GAme 3

Game 4

Kafkahttps://kafka.apache.org/index.html

TIME

LAMPBuilt with

... well, nginx instead of apache

LAMPBuilt with

learned?what have we

FAST ENOUGHmysql is o2en

TIME

cloudTo the

load balancer

master shard 1 master shard 2

slave shard 1 slave shard 2

app server app server app server

load balancer

DB

appapp app app app app

appapp app app app app

appapp app app app app

DB DB DB DB DB

DB DB DB DB DB DB

learned?what have we

use casedifferent

Are NOTarcade games

farming games

slow partsMove

repeatRinse and

learned?what have we

helps, but only to a certain 4tent

machinesAdding more

AutomatedServer Provisioning

RedisPr5 and cons of

facilitate database changes

AbstractionsGood code

Testsgive confidence

are easier to reason aboutChanges

Incremental

are easier to reason aboutRollouts

Incremental

crucialmonitoring is

TIME

dedicatedBack to

MachinesFaster

networkFaster

load balancer

REdis master Redis Slave

app server app server app server

u1_rooms_R1

u1_Pets_P2

u1_Pets_P3

u1_Pets_P4

u1_Pets_P5

u2_Pets_P1

u2_Pets_P2

u1_rooms_R1

u1_Pets_P2

u1_Pets_P3

u1_Pets_P4

u1_Pets_P5

u2_Pets_P1

u2_Pets_P2

REDIS HASH

u1

U2

U3

XPRooms

Patients

XPRooms

Patients

XPRooms

PatientsU4

learned?What have we

placeMagicalShowers are a

a relational databaseNOTRedis is

to move aroundIs easier

Compound user data

Memory Leaks?

work again?BGSAVEHow does

workingno longerDumps are

learned?What have we

AssumptionsValidate your

Restore on Demand

8x it with

DiskArchive user to

RedisRestore to

(never really supported)Disk Store

Redis

learned?What have we

less compl4ityMachines

Less

Archivingkeeps the working set

small

compounduser data is easier to

move around

Trade offUsing Redis as your

main data store

TIME

StatefulLet’s go

is faster than no databasedatabase

NO

s3Am9on

learned?What have we

Erlangis a great environment to build distributed

systems

choice of databasetrumps

Architecture

Statefulis more compl4

lockingDistributed

lockerhttps://github.com/wooga/locker

warlockhttps://github.com/wooga/warlock

http://uu.diva-portal.org/smash/record.jsf?pid=diva2:615805

TIME

EventMAchine

load balancer

Riak Riak Riak Riak Riak

appapp app app

appapp app app

learned?What have we

RiakLife with

Single Point of Failure

NO!!!!!

DataModelling and Access

Redis

Riak Cluster

User DataLevel

XPBuildings

Scenes

Meta DaTa

Friend Index

HighScoreS

clusterRiak

App Server

Riak ?

BackupRiak

Amazon S3Archive to

CreditsPolar bear: http://www.flickr.com/photos/bestrated1/167630455/sizes/o/Family: http://www.flickr.com/photos/adwriter/212098009/sizes/o/cart: http://www.flickr.com/photos/41304880@N05/6187541490/cow closeup: http://www.flickr.com/photos/sovietuk/227465632/sizes/o/sparta: http://www.flickr.com/photos/legofenris/5008721616/sizes/l/tank: http://www.flickr.com/photos/markkelley/1581559810/sizes/l/bomb: http://www.flickr.com/photos/7969902@N07/511234695/scale: http://www.flickr.com/photos/31818720@N00/3273587681/engineering: http://www.flickr.com/photos/31704690@N05/8253753576/duck: http://www.flickr.com/photos/12836528@N00/2785398344/gear: http://www.flickr.com/photos/neurolysis/3335080917/cat: http://www.flickr.com/photos/55753993@N00/2898378081/

Creditschronos: http://www.flickr.com/photos/seeminglee/8581497525clouds: http://www.flickr.com/photos/nirak/644335254dead end: http://www.flickr.com/photos/ableman/298520443sloth: http://www.flickr.com/photos/matthijs/461893969stairs: http://www.flickr.com/photos/the_pale_side_of_insomnia/3010459970server rack: http://www.flickr.com/photos/jamisonjudd/2433102356gauge: http://www.flickr.com/photos/thatguyfromcchs08/2300190277pipe: http://www.flickr.com/photos/autowitch/102513226shower: http://www.flickr.com/photos/pagedooley/2047183582archive: http://www.flickr.com/photos/kasaa/2693784352water tap: http://www.flickr.com/photos/nachett/7852629550

Creditswrenches: http://www.flickr.com/photos/batega/1596898776bike locks: http://www.flickr.com/photos/ibcbulk/256435870lock master: http://www.flickr.com/photos/darwinbelllock : http://www.flickr.com/photos/dzarro72water wheel: http://www.flickr.com/photos/30649191@N00/8686135236starwars family: http://www.flickr.com/photos/kalexanderson/6312014327playdo: http://www.flickr.com/photos/manueb/1674681674microphone: http://www.flickr.com/photos/auralasia/4381121155cluster: http://www.flickr.com/photos/rogersmith/280267119backup: http://www.flickr.com/photos/dippy_duck/4562866718architecture: http://www.flickr.com/photos/bzyla/1331648993library: http://www.flickr.com/photos/fahdad/1718853829

Recommended