AWS Summit Berlin 2013 - EyeEm - A Scalable Cloud Architecture - Lessons Learned
AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community
-
Upload
aws-germany -
Category
Technology
-
view
805 -
download
0
description
Transcript of AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community
![Page 1: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/1.jpg)
![Page 2: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/2.jpg)
Scaling tadaaPhoto Broadcasting
in the Cloud
![Page 3: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/5.jpg)
...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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/6.jpg)
Architecture
![Page 7: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/8.jpg)
Apple Push Notifications Sent
![Page 9: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/10.jpg)
When Instagram Changed T&Cs...
ALL YOUR BASE ARE BELONG TO US
![Page 11: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/11.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/12.jpg)
Juggling 8TB Database Files on
EBS isn‘t Fun.
![Page 13: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/13.jpg)
Hello, DynamoDB!
![Page 14: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/15.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/16.jpg)
Cost Scales Up, too...„How Can we Handle Bursts Better?“
![Page 17: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/17.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/18.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/19.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/20.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/21.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/22.jpg)
It is all well worth it.
![Page 23: AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community](https://reader036.fdocuments.us/reader036/viewer/2022062702/554a418cb4c905863d8b501e/html5/thumbnails/23.jpg)
Thank You!