YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Redis to the Rescue (Buzzwords Berlin)

Redis to the Rescue?

Berlin Buzzwords2011-06-07

Page 2: Redis to the Rescue (Buzzwords Berlin)

Who

• Tim Lossen / @tlossen

• backend developer at wooga

• Berlin, Germany

Page 5: Redis to the Rescue (Buzzwords Berlin)

Goals

• 1 million players per day (“DAU = daily active users”)

Page 6: Redis to the Rescue (Buzzwords Berlin)

Goals

• 1 million players per day (“DAU = daily active users”)

• small production cluster

- less operational overhead

- cheaper

Page 7: Redis to the Rescue (Buzzwords Berlin)

Architecture

Page 9: Redis to the Rescue (Buzzwords Berlin)

Data Model

• user = single Redis hash

- each entity stored in hash field (serialized to JSON)

• custom Ruby mapping layer (“Remodel”)

Page 10: Redis to the Rescue (Buzzwords Berlin)

1220032045 u1 {“level”: 4,“xp”: 241}

u1_pets [“p7”, “p8”]

p7 {“pet_type”: “Cat”}

p8 {“pet_type”: “Dog”}

1234599660 u1 {“level”: 1,“xp”: 22}

u1_pets [“p3”]

... ...

Page 11: Redis to the Rescue (Buzzwords Berlin)

1220032045 u1 {“level”: 4,“xp”: 241}

u1_pets [“p7”, “p8”]

p7 {“pet_type”: “Cat”}

p8 {“pet_type”: “Dog”}

1234599660 u1 {“level”: 1,“xp”: 22}

u1_pets [“p3”]

... ...

Page 12: Redis to the Rescue (Buzzwords Berlin)

Setup A (July 2010)

Page 13: Redis to the Rescue (Buzzwords Berlin)

Setup B (Nov 2010)

Page 14: Redis to the Rescue (Buzzwords Berlin)

Setup B (Dec 2010)

Page 15: Redis to the Rescue (Buzzwords Berlin)

Analysis

• Redis virtual memory not compatible with:

- persistence

- replication

Page 16: Redis to the Rescue (Buzzwords Berlin)

Setup B’ (Dec 2010)

Page 17: Redis to the Rescue (Buzzwords Berlin)

Setup C (Dec 2010)

Page 18: Redis to the Rescue (Buzzwords Berlin)

Setup D (May 2011)

Page 19: Redis to the Rescue (Buzzwords Berlin)

Status

• peak traffic:

- 3000 requests/s

- 35000 Redis operations/s

• average backend response time:

- 10 ms

Page 21: Redis to the Rescue (Buzzwords Berlin)

Goals

• 1 million DAU

• small production cluster

Page 22: Redis to the Rescue (Buzzwords Berlin)

Production Cluster

Text

(1x intel core i7 X980,6 cores, 24 gig ram)

Page 23: Redis to the Rescue (Buzzwords Berlin)

Goals

• 1 million DAU

• small production cluster

Page 24: Redis to the Rescue (Buzzwords Berlin)

Redis Highlights

• high sustained throughput / performance

• very stable

• active & helpful community

Page 25: Redis to the Rescue (Buzzwords Berlin)

Redis Gotchas

• memory consumption

- fragmentation!

• durability

Page 26: Redis to the Rescue (Buzzwords Berlin)

Q & A


Related Documents