dynamodb at hasoffers

22
DynamoDB at HasOffers

Upload: amazon-web-services

Post on 12-Jan-2015

276 views

Category:

Technology


3 download

DESCRIPTION

How HasOffers uses DynamoDB

TRANSCRIPT

Page 1: DynamoDB at HasOffers

DynamoDB at HasOffers

Page 2: DynamoDB at HasOffers

• Attribution for web & mobile marketing• Tons of data• Ad-hoc analysis• Near real-time

Page 3: DynamoDB at HasOffers

18 months in production

207 billion items

87 TB of data

DynamoDB at HasOffers

Page 4: DynamoDB at HasOffers

Tracking sessions

Deduplication

Attribution

Use Cases

Page 5: DynamoDB at HasOffers

Tracking Sessions

Page 6: DynamoDB at HasOffers

Session Data

Use Case: Tracking Sessions

671c6a9a-bed0-4cec-a465-613cca8c9832

• Impression• Click

Page 7: DynamoDB at HasOffers

Use Case: Tracking Sessions

• Ideal for NoSQL

• KV lookups

• Scalability

• Availability

Page 8: DynamoDB at HasOffers

Deduplication

Page 9: DynamoDB at HasOffers

Use Case: Event Deduplication671c6a9a-bed0-4cec-a465-613cca8c9832

ebe0efef-aa71-471c-b3f8-7b66b458bd79

ebe0efef-aa71-471c-b3f8-7b66b458bd79

d149e52c-d2b3-49bc-b6af-f304b5fab57f

DEDUPE!

(Idempotency)

Page 10: DynamoDB at HasOffers

Use Case: Event Deduplication

Hash uuidRange <none>

Write capacity = X, Read capacity = 1

Conditional puts

Page 11: DynamoDB at HasOffers

Use Case: Event Deduplication

DEDUPE!

def is_duplicate( dynamo_tbl, uuid ):

row_data = {‘host’: socket.gethostname(), ‘created’: int(time.time())}

row = dynamo_tbl.new_item( hash_key=uuid, attrs=row_data )

try: row.put( expected_value={‘host’: False} )

except DynamoDBConditionalCheckFailedError: return True

# not a duplicate return False

Page 12: DynamoDB at HasOffers

Use Case: Event Deduplication

DEDUPE!

• Real-time dedupe• Conditional put• Writes only; no read• Extra debug info

{uuid: d149e52c-d2b3-49bc-b6af-f304b5fab57f, host: server03.hasoffers.com, created: 1398884990}

Page 13: DynamoDB at HasOffers

Why NoSQL SaaS?

Page 14: DynamoDB at HasOffers

• Upsize and downsize trivial in DynamoDB

• Infrequent on own cluster = limits operational experience

Cluster Resizing

Page 15: DynamoDB at HasOffers

Cluster Software Updates

0.7 1.0

• Production depends on NoSQL solution

being available.

• Software version updates somewhere

between nail-biting and terrifying

Page 16: DynamoDB at HasOffers

Dynamo Operations

Page 17: DynamoDB at HasOffers

Per table R/W capacity

Capacity units

Exceed = throttling

DynamoDB Capacity

Page 18: DynamoDB at HasOffers

DynamoDB Throttling

CloudWatch = 5 minutes

DynamoDB = 1 second

Page 19: DynamoDB at HasOffers

DynamoDB Throttling

• Double capacity on table

• Root cause from log analysis– capacity usage

– key hot-spotting

• Fix root cause

• Reduce capacity on table

Page 20: DynamoDB at HasOffers

Closing Thoughts

Page 21: DynamoDB at HasOffers

• Compelling offering

• Simple operations

• Avoid hammer syndrome

• Very happy

Closing Thoughts

Page 22: DynamoDB at HasOffers

Thank you!

[email protected]