Upload
wooga
View
771
Download
0
Tags:
Embed Size (px)
Citation preview
app
slave
master master
slave
1. create new DBs
2. setup replication
3. start using masters
4. cut replication
5. truncate data
BA
AB
AB
AB
AB
Stateless approach
1+ million users / day
10+ billion requests / month
~10 DB writes / request
> 100,000 DB writes / second
http://www.flickr.com/photos/biblicone/3425903181/sizes/l/in/photostream/
Things we did
Many small optimisations
Bigger databases…
… many, many more of them
… and finally the right thing!
SQL SQL
sql sql
SQL SQL
sql sql
SQL SQL
sql
Rd Rd
rd rd
Rd Rd
rd rd
Rd Rd
rd rd
Rd Rd
rd rd
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
SQL
EBS EBS EBS EBS
lb lblblb
SQL SQL
sql sql
SQL SQL
sql sql
SQL SQL
sql
Rd Rd
rd rd
Rd Rd
rd rd
Rd Rd
rd rd
Rd Rd
rd rd
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
app appapp app app app app app app app app appapp app app
SQL
EBS EBS EBS EBS
lb lblblb
38 single points of failure
Stateful approach
1+ million users / day
4 sessions / user / day
1 DB write / session
~50 DB writes / second
Server
sessionsessionsessionsession
Server
sessionsessionsessionsession
Server
sessionsessionsessionsession
S3
Being transparent
flickr.com/photos/marcomagrini/698692268
flickr.com/groups/bestfavoriterelayrace/
Rotating jobs
offline
DD
Erlang
statefulML
2011
Redis
Ruby
Riak
Javascript
ev. Ruby
1 doc
LAMP
statelessBB BI
MW
HH
MW 2
PI
PP
MWM
2012
Erlang
Redis
Ruby
stateful
Riak
Javascript
offline
ev. Ruby
1 doc
JRuby
shared
LAMP
multiplay
statelessBB BI
MW
HH
MW 2
ML
DD
PI
PP
MWM PV
GX
FT
KB
BI 2
2013
Erlang
Redis
Ruby
stateful
Riak
Javascriptrealtime
offline
ev. Ruby
1 doc
JRuby Scala
shared
LAMP
generic
multiplay
stateless
services
BB BI
MW
HH
MW 2
ML
DD
PI
PP
MWM PV
SBS
DYN
GX
FT
KB
BI 2
DIV
…
2014
Erlang
Redis
Ruby
stateful
Riak
Javascriptrealtime
offline
ev. Ruby
1 doc
JRuby Scala
shared
LAMP
generic
multiplay
stateless
services
BB BI
MW
HH
MW 2
ML
DD
PI
PP
MWM PV
SBS
DYN
GX
FT
KB
BI 2
DIV
… …
Erlang
Redis
Ruby
stateful
Riak
Javascriptrealtime
offline
ev. Ruby
1 doc
JRuby Scala
shared
Go
Elixir
hybrid
LAMP
generic
multiplay
stateless
services
BB BI
MW
HH
MW 2
ML
DD
PI
PP
MWM PV
SBS
DYN
GX
FT
KB
BI 2
DIV
… …
…
…
…2015
Erlang
Redis
Ruby
stateful
Riak
Javascriptrealtime
offline
ev. Ruby
1 doc
JRuby Scala
shared
Go
Elixir
hybrid
LAMP
generic
multiplay
stateless
services2015
MySQLPython
Python MySQL
Erlang
RedisRuby stateful
Riak
Javascript
realtime
offline
ev. Ruby
1 doc
JRuby
Scala
shared
Go
Elixir
hybrid
generic
multiplay
stateless
services
Languages DBs State mngt. Misc.
Python MySQL
Erlang
RedisRuby stateful
Riak
Javascript
realtime
offline
ev. Ruby
1 doc
JRuby
Scala
shared
Go
Elixir
hybrid
generic
multiplay
stateless
services
Languages DBs State mngt. Misc.
Wooga’stoolbox
“Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.”
- Agile Manifesto