nosql games
DESCRIPTION
This talk explains how we use NoSQL databases at wooga to scale our backend services to deal with the data of millions of players every day. Learn from our experience running Basho's Riak in production and how to use Amazon S3 as a database.TRANSCRIPT
NOSQL GAMESPatrick Hueslerwooga GmbH
play?D! "!# $%&' (!
challengestechnical
for Diamond Dash20,543,500monthly active users
http://www.appdata.com/apps/facebook/127995567256931-diamond-dash (03/10/2012)
for Diamond Dash3,871,133daily active users
http://www.appdata.com/apps/facebook/127995567256931-diamond-dash (03/10/2012)
for Monster World6,500 RPS
backend traffic up to
Database?what does mean that for a
write heavyread/write ratio?
of architectureEVOLUTION
Wooga’s
Game backend
iOS
Flash
Reporting
... well, nginx instead of apache
LAMPBuilt with
scalemysql does
use casesfor certain
peoplewith the right
cloudTo the
instead of PHPRailsLet’s use
load balancer
app server app server app server
master shard 1 master shard 2
slave shard 2 slave shard 2
shortstory
long
load balancer
app app app app app app app app
db db db db db db db db
db db db db db db db db
app app app app app app app app
app app app app app app app app
use casedifferent
Are NOTarcade games
farming games
going to workNOT
5is is
at the end of the tunnelLight
but there is
to redisSLOW PARTS
Move
rinsE and REPEAT
dedicatedback to
for the buckbangMore
MachinesFaster
networkfaster
all the wayREdisLet’s use
load balancer
app server app server app server
redis
redis slave
REDIS HASH
Redis Landall is well in
Memory Leaks
work again?BGSAVEhow does
workingno longerdumps are
going to workNOT
5is is
Restore on Demand
6x it with
(never really supported)Disk Store
Redis
StatefulLet’s go
is faster than no databasedatabase
no
all the wayS3
Let’s use
erlangLet’s use
http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
SPARTANproject
yesterdayready
it has to be
enormouslyscale
It has to
node.js
without sharding?Scales
What DB
masterless replication?
what DB has
Async Saving
Riak
for nowgood enough
for goodgood enough
Riaklife with
1 { 2 "userId" : 1000000011100, 3 "xp" : 20, 4 "coins" : 400, 5 "cash" : 300, 6 "rooms" : [ 7 { 8 "id" : 1, 9 "type" : "x-ray", 10 "status" : "busy" 11 } 12 ] 13 } 14
is plain awesomeSPoF
no
for our use casesuboptimal
bitcask was
over all keys!map/reduce
Do not
ulimitdread8l
riak Attachthe tale of
MobileMonsters go
a flash clientNOT
An iOS client is
at all?databasedo we need a
in a stateless architecture?s3
Could we just use
at all?backenddo we need a
writes toclientwhat if the
S3?
wooga.com/jobs
Referenced Presentationshttp://www.slideshare.net/wooga/how-to-handle-1000000-daily-users-without-using-a-cache-railswaycon-2012
http://www.slideshare.net/wooga/event-stream-processing-with-kafka-berlin-buzzwords-2012
http://www.slideshare.net/wooga/from-0-to-1000000-daily-users-with-erlang
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/