aws summit berlin 2013 - tadaa - hd camera and photo community

24

Upload: aws-germany

Post on 06-May-2015

803 views

Category:

Technology


0 download

DESCRIPTION

tadaa is the camera app replacing your DSLR, coupled with a massive community of pro and amateur photographers. Let's talk about cost-efficient living, scaling and growing in the cloud. Speaker: Friedemann Wachsmuth, CTO, menschmaschine Publishing GmbH

TRANSCRIPT

Page 1: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community
Page 2: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Scaling tadaaPhoto Broadcasting

in the Cloud

Page 3: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

What is tadaa?

•HD Camera & Photo Editor for iOS

•Photosharing Community for Prosumers

•3 Million App Users

Page 4: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

tadaa is a Realtime Application...

•Constant Relationship Changes

•Reactions, Interactions & Notifications

•Fan-outs, Deletions

•Sync Notification Counts

Page 5: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

...with a Lot of Data Underneath

•250M Contact Hashes

•Hundreds of Millions of Images on S3

•~2500 Messages / Second

Page 6: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Architecture

Page 7: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Architecture

•100% Hosted on AWS

•Mostly Using AWS Services: EC2, EMR, CloudFront, S3, DynamoDB, ElastiCache, CloudWatch, IAM...

Page 8: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Apple Push Notifications Sent

Page 9: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Load can be Bursty

•If a Single User has 10k Followers

➡ One Photo can cause 10k Push Notifs!

•With 25% Open Rate, they create

➡ 2500 API calls within few Seconds

•leading to Thousands of Likes and Reactions... Within a few Seconds.

Page 10: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

When Instagram Changed T&Cs...

ALL YOUR BASE ARE BELONG TO US

Page 11: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Using CouchDB...Pros:

•Simple REST API

•Replicates

•Schemaless

•Map/Reduce

•Everything versioned

Cons:

•Sharding is Hard

•JSON = Data Inflation

•Very Disk-I/O Dependent

•Everything versioned

Page 12: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Juggling 8TB Database Files on

EBS isn‘t Fun.

Page 13: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Hello, DynamoDB!

Page 14: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Moving to DynamoDB

•Predictable Performance

•Infinite Table Size

•Full Redundancy

•8TB Became 150GB!

Page 15: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

DynamoDB Scales

•We Migrated the Live System with no Downtime within a Few Days

•Query Latency is Really just 2-3ms

•Worst Value ever seen was 8ms

•Now You get Some Free Burst Allowance!

Page 16: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Cost Scales Up, too...„How Can we Handle Bursts Better?“

Page 17: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Optimizing Access Patterns

•Level Your Reads and Writes

•Vary Hashkeys

•Throttle Non-Realtime Tasks

•Mirror in ElastiCache Where Possible, Persist Lazily

➡ Reduce Required CUs by 75%

Page 18: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Leveling Reads/Writes

•Avoid Bursts and Scans

•Queue Your I/O through a Messaging System

•If You Can, Separate Hot and Cold Data

Page 19: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Vary Your Hashkeys

•Your Table is Partitioned

•# of Partitions Grows with Size of Table and Provisioned CUs

• You don‘t know the # of Actual Partitions

•You only get your Provisioned CUs when using all Partitions Equally!

Page 20: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Throttle Non-Realtime Tasks

•Purge old Data through a Throttled Message Queue

•Spool Data with expected Redundancies and drain only the uniqued Changes (e.g. Facebook LiveAPI)

•Scale your Worker Throughput based on CloudWatch Data

Page 21: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Use ElastiCache for hot Data

•Write hot Data to ElastiCache and your DAL

•Alter Hot Data in the Cache (e.g. Like-Counts)

•Benefit e.g. from Increments

•Read latest Data from Cache once you persist to DynamoDB

Page 22: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

It is all well worth it.

Page 23: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

Thank You!

Page 24: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community

[email protected]

@peaceman