ogdc 2013 choosing the right database for social mobile game

21
CHOOSING THE RIGHT DATABASE for SOCIAL and MOBILE GAMES Nguyen Thanh Quan Lead System Engineer SO6 - G6 Division

Upload: son-aris

Post on 09-May-2015

186 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Ogdc 2013 choosing the right database for social mobile game

CHOOSING THE RIGHT

DATABASE for SOCIAL and

MOBILE GAMES

Nguyen Thanh Quan

Lead System Engineer

SO6 - G6 Division

Page 2: Ogdc 2013 choosing the right database for social mobile game

Talk Overview

Part II. Decision principlesPart III. Choosing the right database

Part I. Our story

Page 3: Ogdc 2013 choosing the right database for social mobile game

• G6’s typical social game

• Game architecture

• Problems

• Evolution

4POINTS

Part I. Our story

Page 4: Ogdc 2013 choosing the right database for social mobile game

G6’s typical social game

Page 5: Ogdc 2013 choosing the right database for social mobile game

Game architecture

• High production

quality game

• Game logic in

client

• Can keep a socket

Flash

Client Side

Server Side

• Base on a LAMP

stack

• Game logic in PHP

• HTTP connection

Web stack

Page 6: Ogdc 2013 choosing the right database for social mobile game

Client

Web server #1

Web server #n

Web server #2

Game architecture

Page 7: Ogdc 2013 choosing the right database for social mobile game

Game architecture

-

50,000

100,000

150,000

200,000 DAUs

DAUs

Page 8: Ogdc 2013 choosing the right database for social mobile game

Problems

• Memory, hardware

has limitation

• Not easy for scaling

out

• 4,000 operation per

second

• 1,000 write per

second

• Parsing, locking,

logging, threads …

Page 9: Ogdc 2013 choosing the right database for social mobile game

Evolution

Data is growing rapidly

Hardware is not merging as that of data growth

Hard to scale using traditional way

Page 10: Ogdc 2013 choosing the right database for social mobile game

Part II. Decision principles

High performan

ce

High availabili

ty

High scalabilit

yLow in cost

Outage stories: zynga, wooga

Page 11: Ogdc 2013 choosing the right database for social mobile game

Part III. Choosing the right database

Page 12: Ogdc 2013 choosing the right database for social mobile game

Pick the right tool for the job

Page 13: Ogdc 2013 choosing the right database for social mobile game

Why NoSQL?

HighPerformance

High Scalabilit

y

Always On

Flexible Data

Model

Page 14: Ogdc 2013 choosing the right database for social mobile game

NoSQL – Disadvantage

• Can’t be use for analytics, reporting …

• Lack of relation from one key to another

• Packing and un-packing of each key

• Need whole value from the key; to

read/write any partial information

Page 15: Ogdc 2013 choosing the right database for social mobile game

Comparison

• Fast enough

• Disk based

• 4,000 OPS

• 1,000 write/s

MySQL

• Super fast

• RAM based

• 50,000 OPS

• Writes are fast as

reads

NoSQL

Page 16: Ogdc 2013 choosing the right database for social mobile game

Game architecture

Client

Web #1

Web #n

Web #2

NoSQL

DB

Real-time dataAnalytics data

Page 17: Ogdc 2013 choosing the right database for social mobile game

Our result

We reached 1 million DAUs

-

500,000

1,000,000

1,500,000

2,000,000

DAUs

DAUs

Page 18: Ogdc 2013 choosing the right database for social mobile game

Next stories

… and our journey continues…

Page 19: Ogdc 2013 choosing the right database for social mobile game

-

50,000

100,000

150,000

200,000

DAUs

DAUs

Summarize

Evolution everyday

Page 20: Ogdc 2013 choosing the right database for social mobile game

Revolution if necessary

Summarize

Page 21: Ogdc 2013 choosing the right database for social mobile game

OPEN GAME DEVELOPMENT

CONFERENCE

2013

Nguyen Thanh Quan

Lead System Engineer

SO6 - G6 Division