Post on 12-Jul-2015
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
ARC313
So You Think You Can Architect?Constantin Gonzalez and Jan Metzner
Solutions Architects, Amazon Web Services Germany
Michael Sandbichler, CTO, ProSiebenSat.1 Digital GmbH
November 13, 2014 | Las Vegas
What you’ll get out of this session
• New ideas for your architecture
• More time through delegating problems away
• Less worries about security, scalability and
complexity
ProSiebenSat.1
ProSiebenSat.1 Media AG
Keep Your Light ShiningLive-voting show in german television
ProSiebenSat.1 - at a glance
The show• Live show
• 9 candidates sing one song
• 30 seconds to convince the
audience
• 8 rounds
• Candidate with lowest ratio
is knocked out
• Online voters are the only
judges
Short clip
How the voting works• Log in with Facebook
to participate in web
app
• 1 vote per candidate
per round
• Ratio of votes is
visualized with a light
show
Setting the scene• Show fully depends on Live-Voting Application
• 3 months to deliver a solution from scratch
• Show concept and voting app were developed in parallel
• Casting show in Brazil and quiz show in Germany ended in disaster
after failure of live-voting
ChallengesMajor difference between online app and interactive TV
• Different broadcast delays,
different „realtimes“, but one
user experience
• 90% load within seconds
• 500k concurrent users expected – but prepare for 3 mio
• 100% availability required – no „build-measure-learn“
If the voting fails, the show is dead
• 100% connectivity: LTE saved the show
Cable: 7sec
Antenna: 9sec
Satellite: 5sec
How would you build it?
• Be paranoid: Werner is right – and don‘t rely on WiFi
• Keep it simple: Make it work on the CEOs Blackberry
• Talk to AWS!
Werner Vogels: „Everything fails all the time“
• 30% conversion from TV to app
• 12 million votes in 3 shows
• 100% availability
• >400.000 new downloads
of mobile app in 3 weeks
Did it work? Yes!
Before we start
Background• Voting mechanics
– 1 vote per user
– Vote aggregation
– Time enforcement
• Millions of users
• Requirements– Secure
– Scalable
– Fault-tolerant
Functions
• Authentication/authorization
• Vote collection
• Voting mechanics
• Vote aggregation
• Vote persistency
Layers
Client Endpoint Back end Database
Client
• KISS
• Configure dynamically
• Use the AWS SDKs
Amazon
Cognito
Amazon
Mobile Analytics
Amazon
Mobile SDK
Amazon SNS Push
Notifications
Layers
Client Endpoint Back end Database
Let’s start architecting
Layers
Endpoint Back end Database
Layers
Endpoint Back end DatabaseEndpoint Back end Database
By the Book
Endpoint Back end Database
Scalable
Best practices
Easy to set up
Endpoint security?
ELB* pre-warming?
Database scalability?
* ELB: Elastic Load Balancing
NoSQL
Endpoint Back end
Scalable
Best practices
Easy to set up
Endpoint security?
ELB pre-warming?
Database scalability?capacity?
DatabaseBack endd
Shazam uses Amazon SQS + DynamoDB
NoSQL
Endpoint database
Scalable
Best practices
Easy to set up
Endpoint security?
ELB pre-warming?
Database capacity?Back end
+
Database capacity
Can we simplify?
NoSQL +
Endpoint database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security?
ELB pre-warming?
Back end
Amazon Cognito
provider = new CognitoCredentialsProvider(context, AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH, COGNITO_ROLE_AUTH);
…not only to Amazon SQSSession.openActiveSessionFromCache(LoginActivity.this);client = new AmazonSQSClient(provider);client.sendMessage("https://sqs.eu-west-1.amazonaws.com/1234567890/myqueue", "message");logins = new HashMap<String, String>();put("graph.facebook.com ", token);provider.setLogins(logins);
Let the app talk directly to Amazon SQS
NoSQL +
Endpoint database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security?
ELB pre-warming?
Back-endBack end D
NoSQL +
Endpoint Database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security
ELB pre-warming?
Back end
NoSQL +
Endpoint Database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security
ELB pre-warming
Back end
QueueSQL
Endpoint Database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security
ELB pre-warming
Back end
Endpoint Database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security
ELB pre-warming
100% decoupled
Back end
QueueSQL
Endpoint Database
Scalable
Best practices
Easy to set up
Database capacity
Endpoint security
ELB pre-warming
100% decoupled
Back end
QueueSQL
Can scale
lazily!
RTL Interactive architecture
Temporary
security
credentials
AWS
Security Token
Service
Register and
get credentials
Store/retrieve
user data
Send
check-in/vote
Internal task
processingAmazon
ElastiCache
Process votes
Vote aggregation
persistence
Beyond architecture
Plan thoroughly
• Make the right assumptions
• Try out many variants
• Think stuff through
Never do it alone
• Partners
• AWS Solutions Architects
• AWS Training
• AWS Support
Test early, test often
• At least (!) 4 weeks before
• End-to-end
• Both function and load
Load testing
Try wrk (https://github.com/wg/wrk) to load test http servers
(also Amazon SQS) in parallel from several instances
Conclusion• The best architects are lazy
• More than just infrastructure
• Get more time to:
– Innovate
– Differentiate
– Disrupt