Top Banner
PROGRAMMING AMAZON WEB SERVICES Danilo Poccia | Solutions Architect
79
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Programming Amazon Web Services

PROGRAMMING AMAZON WEB SERVICES

Danilo Poccia | Solutions Architect

Page 2: Programming Amazon Web Services

“PROGRAMMING”

DIFFERENT MEANINGS

IN

DIFFERENT TIMES

Page 3: Programming Amazon Web Services

AT THE

BEGINNING

(FOR ME)

WAS

THIS

Page 4: Programming Amazon Web Services

THERE

WERE

NO “APPS”

SO I HAD TO WRITE SOMETHING

Page 5: Programming Amazon Web Services

CROSSING MY FINGERS

INSTALLING MY FIRST LINUX

Page 6: Programming Amazon Web Services

EVERYTHING

CHANGED

WITH

WWW

Page 7: Programming Amazon Web Services

http://petelepage.com/blog/2011/11/html5-guy-gelaskin/

Page 8: Programming Amazon Web Services

A RICH CLIENT

EXPERIENCE IN

MY BROWSER

CAN HTTP

BE THE LIMIT?

Page 9: Programming Amazon Web Services

WEBSOCKETS

Page 10: Programming Amazon Web Services

WEBSOCKETS

FULL-DUPLEX

Page 11: Programming Amazon Web Services

WEBSOCKETS

FULL-DUPLEX

(NO POLLING)

Page 12: Programming Amazon Web Services

WEBSOCKETS

HANDSHAKE

Page 13: Programming Amazon Web Services

WEBSOCKETS

HANDSHAKE

GET /chat HTTP/1.1

Host: server.example.com

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==

Origin: http://example.com

Sec-WebSocket-Protocol: chat, superchat

Sec-WebSocket-Version: 13

Page 14: Programming Amazon Web Services

WEBSOCKETS

HANDSHAKE

GET /chat HTTP/1.1

Host: server.example.com

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==

Origin: http://example.com

Sec-WebSocket-Protocol: chat, superchat

Sec-WebSocket-Version: 13

HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=

Sec-WebSocket-Protocol: chat

Page 15: Programming Amazon Web Services

• server.js

• package.json

• Player.js

• public/

• index.html

• style/

• reset.css

• game.css

• js/

• requestAnimationFrame.js

• Input.js

• game.js

• Player.js

SERVER

CLIENT

Page 16: Programming Amazon Web Services

• server.js

• package.json

• Player.js

• public/

• index.html

• style/

• reset.css

• game.css

• js/

• requestAnimationFrame.js

• Input.js

• game.js

• Player.js

SINGLE

APP

Node.js

+

Socket.IO

Page 17: Programming Amazon Web Services

“HOW

DO I DEPLOY

MY APP ?”

Page 18: Programming Amazon Web Services

You need to deal with infrastructure

Page 19: Programming Amazon Web Services

ON-DEMAND

PAY AS YOU GO

ELASTIC

Page 20: Programming Amazon Web Services

On a global footprint

Region

US-WEST (N. California) EU-WEST (Ireland)

ASIA PAC

(Tokyo)

ASIA PAC

(Singapore)

US-WEST (Oregon)

SOUTH AMERICA (Sao

Paulo)

US-EAST (Virginia)

GOV CLOUD

ASIA PAC

(Sydney)

Page 21: Programming Amazon Web Services

ELASTIC

BEANSTALK QUICKLY DEPLOY AND MANAGE

APPLICATIONS

Page 22: Programming Amazon Web Services

CHOOSE YOUR CONTAINER

Page 23: Programming Amazon Web Services

DEPLOY

YOUR

APPLICATION

Page 24: Programming Amazon Web Services

User Application

Application Service

HTTP Service

Language Interpreter

Operating System

Host

THE CONTAINER

IS CREATED IN EC2

Page 25: Programming Amazon Web Services

ELASTIC BEANSTALK TAKES CARE

OF THE ENVIRONMENT

Page 26: Programming Amazon Web Services

ADDING

ELASTIC LOAD BALANCER

Page 27: Programming Amazon Web Services

CONFIGURING

AUTO SCALING GROUP

Page 28: Programming Amazon Web Services

LAUNCHING

INSTANCE(S)

Page 29: Programming Amazon Web Services

ALL WIRED WITH

ELASTIC

BEANSTALK

Page 30: Programming Amazon Web Services

APPLICATION IS PUBLISHED

UNDER A CNAME

Page 31: Programming Amazon Web Services

WITH LOGS AND

APP VERSIONS

STORED

IN S3

Page 32: Programming Amazon Web Services

HOW

DO YOU CREATE

AN

APPLICATION

FOR

ELASTIC BEANSTALK ?

Page 33: Programming Amazon Web Services

LIKE

ANY

OTHER

APPLICATION

Page 34: Programming Amazon Web Services

Source uploaded and executed in AWS

Source downloaded

and executed locally NO DEPENDENCIES ON AWS

FOR BEANSTALK DEPLOYMENT

Page 35: Programming Amazon Web Services

Java .war file

Microsoft Web

Deploy package

PHP .zip file

Python .zip file

Git integration IDE plugins

PACKAGE UP AS NORMAL

Page 36: Programming Amazon Web Services

CONSOLE DEPLOYMENTS

AND VERSION UPDATES

Page 37: Programming Amazon Web Services

CheckDNSAvailability elastic-beanstalk-check-dns-availability

CreateApplication elastic-beanstalk-create-application

CreateApplicationVersion

elastic-beanstalk-create-application-version

CreateEnvironment

elastic-beanstalk-create-environment

eb init wizard to initialize an application

eb start/stop start/stop an application

eb update

update application version

eb status

get status of a running application

COMMAND LINE TOOLS

AND “WIZARDS”

Page 38: Programming Amazon Web Services

ECLIPSE INTEGRATION

Page 39: Programming Amazon Web Services

VISUAL STUDIO INTEGRATION

Page 40: Programming Amazon Web Services

GIT INTEGRATION

Page 41: Programming Amazon Web Services

CONTAINER CONFIGURATION

Page 42: Programming Amazon Web Services
Page 43: Programming Amazon Web Services

“Elastic Beanstalk ci ha permesso di

sfruttare la potenza dell’Auto Scaling di

EC2 senza alcuna fatica.

La procedura di deploy integrata con

git è veramente comoda e veloce.”

FunGo Studios

www.fungostudios.com

Page 44: Programming Amazon Web Services

AWS Elastic

Beanstalk

AWS

OpsWorks AWS

CloudFormation

Amazon EC2

Page 45: Programming Amazon Web Services

AWS Elastic

Beanstalk

AWS

OpsWorks AWS

CloudFormation

Amazon EC2

CONVENIENCE CONTROL

Page 46: Programming Amazon Web Services

AWS Elastic

Beanstalk

AWS

OpsWorks AWS

CloudFormation

Amazon EC2

CONVENIENCE CONTROL

HIGH-LEVEL DO IT YOURSELF

Page 47: Programming Amazon Web Services

THERE IS

NO ADDITIONAL CHARGE

FOR USING

ELASTIC BEANSTALK

OPSWORKS

CLOUDFORMATION

Page 48: Programming Amazon Web Services

YOU PAY ONLY FOR THE

AWS RESOURCES

NEEDED TO

STORE AND RUN

YOUR

APPLICATIONS

Page 49: Programming Amazon Web Services

= PROGRAMMABLE

PLATFORM

Page 50: Programming Amazon Web Services

API | SDK | CLI

Page 51: Programming Amazon Web Services

API | SDK | CLI

Page 52: Programming Amazon Web Services
Page 53: Programming Amazon Web Services
Page 54: Programming Amazon Web Services
Page 55: Programming Amazon Web Services
Page 56: Programming Amazon Web Services
Page 57: Programming Amazon Web Services
Page 58: Programming Amazon Web Services

“Amazon DynamoDB initially served as a secondary data

store for user activity and interaction logs.

However, this new NoSQL database service was

integrated into the production environment as the primary

data store when Shazam realized it could support over

500,000 writes per second.

The company is also using Amazon EMR for large-scale

data analysis that can require more than 1 million writes

per second.”

Page 59: Programming Amazon Web Services
Page 60: Programming Amazon Web Services

“All files stored

online by Dropbox

are encrypted and

kept securely on

Amazon’s Simple

Storage Service

(S3) in multiple data

centers located

across the United

States.”

Page 61: Programming Amazon Web Services

Object Storage

Send Email

Message Queue

Notification (Pub & Sub)

NoSQL DB

Video Transcoding

Content Delivery

Monitoring

WHAT DO I NEED TO ? DO

Page 62: Programming Amazon Web Services

S3

SES

SQS

SNS

DynamoDB

Elastic Transcoder

CloudFront

CloudWatch

Object Storage

Send Email

Message Queue

Notification (Pub & Sub)

NoSQL DB

Video Transcoding

Content Delivery

Monitoring

WHAT DO I NEED TO ?

Page 63: Programming Amazon Web Services

AWS is a set of building blocks

Page 64: Programming Amazon Web Services

« Improving daily work is even

more important than doing daily

work. »

Gene Kim, Kevin Behr, George Spafford,

The Phoenix Project: A Novel About IT, DevOps,

and Helping Your Business Win

Page 65: Programming Amazon Web Services

var AWS = require('aws-sdk');

sqs = new AWS.SQS();

Page 66: Programming Amazon Web Services

sqs.client.getQueueUrl(

{ QueueName: 'JustAGame-Queue’ },

function(err, data) {

if (!err) {

console.log("Get Queue URL: "+data.QueueUrl);

queueUrl = data.QueueUrl;

} else {

console.log("Error getting Queue URL: "+err);

}

}

);

Page 67: Programming Amazon Web Services

sqs.client.sendMessage(

{

QueueUrl: queueUrl,

MessageBody: 'onNewPlayer id: '+this.id

},

function(err, data) {

if (!err) {

console.log("Message sent, id: "+data.MessageId);

} else {

console.log("Error sending message: "+err);

}

}

);

Page 68: Programming Amazon Web Services

SCALABILITY

Page 69: Programming Amazon Web Services

SESSION DATA

SCALABILITY

OTHER DATA

Page 70: Programming Amazon Web Services

SESSION DATA

SCALABILITY

OTHER DATA

DynamoDB Redis

Memcached/ElastiCache …

DynamoDB MySQL/RDS

Redis …

Page 71: Programming Amazon Web Services

TIME FOR

A DEMO

Page 72: Programming Amazon Web Services
Page 73: Programming Amazon Web Services

A prototype shouldn't require big investments…

Page 74: Programming Amazon Web Services

…it should be cheap and validate ideas

Page 75: Programming Amazon Web Services

Problem:

Needed to reduce IT costs and were looking

to create a more flexible IT environment

Solution:

AWS’s low, pay-as-you-go prices and reliable

services. With every request, the application

authenticates devices, delivers apps and

content, and pushes notifications.

Business Benefits:

Saved $34M in hardware and maintenance

expenses, 85% less than running on-

premises

Samsung saved $34M on their Smart Hub

application

Page 76: Programming Amazon Web Services

INNOVATE

Page 77: Programming Amazon Web Services

« Want to increase innovation?

Lower the cost of failure »

Joi Ito

Page 78: Programming Amazon Web Services

http://aws.amazon.com/free

Page 79: Programming Amazon Web Services