(arc313) so you think you can architect? | aws re:invent 2014

43
© 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

Upload: amazon-web-services

Post on 12-Jul-2015

791 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

© 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

Page 2: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 3: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

ProSiebenSat.1

Page 4: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

ProSiebenSat.1 Media AG

Keep Your Light ShiningLive-voting show in german television

Page 5: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

ProSiebenSat.1 - at a glance

Page 6: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 7: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Short clip

Page 8: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 9: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 10: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 11: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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“

Page 12: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

• 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!

Page 13: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Before we start

Page 14: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Background• Voting mechanics

– 1 vote per user

– Vote aggregation

– Time enforcement

• Millions of users

• Requirements– Secure

– Scalable

– Fault-tolerant

Page 15: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Functions

• Authentication/authorization

• Vote collection

• Voting mechanics

• Vote aggregation

• Vote persistency

Page 16: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Layers

Client Endpoint Back end Database

Page 17: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Client

• KISS

• Configure dynamically

• Use the AWS SDKs

Amazon

Cognito

Amazon

Mobile Analytics

Amazon

Mobile SDK

Amazon SNS Push

Notifications

Page 18: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Layers

Client Endpoint Back end Database

Page 19: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Let’s start architecting

Page 20: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Layers

Endpoint Back end Database

Page 21: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Layers

Endpoint Back end DatabaseEndpoint Back end Database

Page 22: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 23: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL

Endpoint Back end

Scalable

Best practices

Easy to set up

Endpoint security?

ELB pre-warming?

Database scalability?capacity?

DatabaseBack endd

Page 24: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Shazam uses Amazon SQS + DynamoDB

Page 25: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL

Endpoint database

Scalable

Best practices

Easy to set up

Endpoint security?

ELB pre-warming?

Database capacity?Back end

+

Database capacity

Page 26: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Can we simplify?

Page 27: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL +

Endpoint database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security?

ELB pre-warming?

Back end

Page 28: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 29: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL +

Endpoint database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security?

ELB pre-warming?

Back-endBack end D

Page 30: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL +

Endpoint Database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security

ELB pre-warming?

Back end

Page 31: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

NoSQL +

Endpoint Database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security

ELB pre-warming

Back end

Page 32: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

QueueSQL

Endpoint Database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security

ELB pre-warming

Back end

Page 33: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Endpoint Database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security

ELB pre-warming

100% decoupled

Back end

QueueSQL

Page 34: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Endpoint Database

Scalable

Best practices

Easy to set up

Database capacity

Endpoint security

ELB pre-warming

100% decoupled

Back end

QueueSQL

Can scale

lazily!

Page 35: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014
Page 36: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

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

Page 37: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Beyond architecture

Page 38: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Plan thoroughly

• Make the right assumptions

• Try out many variants

• Think stuff through

Page 39: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Never do it alone

• Partners

• AWS Solutions Architects

• AWS Training

• AWS Support

Page 40: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Test early, test often

• At least (!) 4 weeks before

• End-to-end

• Both function and load

Page 41: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Load testing

Try wrk (https://github.com/wg/wrk) to load test http servers

(also Amazon SQS) in parallel from several instances

Page 42: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

Conclusion• The best architects are lazy

• More than just infrastructure

• Get more time to:

– Innovate

– Differentiate

– Disrupt

Page 43: (ARC313) So You Think You Can Architect? | AWS re:Invent 2014

http://bit.ly/awsevals