programming amazon web services
DESCRIPTION
TRANSCRIPT
![Page 1: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/1.jpg)
PROGRAMMING AMAZON WEB SERVICES
Danilo Poccia | Solutions Architect
![Page 2: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/2.jpg)
“PROGRAMMING”
DIFFERENT MEANINGS
IN
DIFFERENT TIMES
![Page 3: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/3.jpg)
AT THE
BEGINNING
(FOR ME)
WAS
THIS
![Page 4: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/4.jpg)
THERE
WERE
NO “APPS”
SO I HAD TO WRITE SOMETHING
![Page 5: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/5.jpg)
CROSSING MY FINGERS
INSTALLING MY FIRST LINUX
![Page 6: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/6.jpg)
EVERYTHING
CHANGED
WITH
WWW
![Page 7: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/7.jpg)
http://petelepage.com/blog/2011/11/html5-guy-gelaskin/
![Page 8: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/8.jpg)
A RICH CLIENT
EXPERIENCE IN
MY BROWSER
CAN HTTP
BE THE LIMIT?
![Page 9: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/9.jpg)
WEBSOCKETS
![Page 10: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/10.jpg)
WEBSOCKETS
FULL-DUPLEX
![Page 11: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/11.jpg)
WEBSOCKETS
FULL-DUPLEX
(NO POLLING)
![Page 12: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/12.jpg)
WEBSOCKETS
HANDSHAKE
![Page 13: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/13.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/14.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/15.jpg)
• 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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/16.jpg)
• 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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/17.jpg)
“HOW
DO I DEPLOY
MY APP ?”
![Page 18: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/18.jpg)
You need to deal with infrastructure
![Page 19: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/19.jpg)
ON-DEMAND
PAY AS YOU GO
ELASTIC
![Page 20: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/20.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/21.jpg)
ELASTIC
BEANSTALK QUICKLY DEPLOY AND MANAGE
APPLICATIONS
![Page 22: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/22.jpg)
CHOOSE YOUR CONTAINER
![Page 23: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/23.jpg)
DEPLOY
YOUR
APPLICATION
![Page 24: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/24.jpg)
User Application
Application Service
HTTP Service
Language Interpreter
Operating System
Host
THE CONTAINER
IS CREATED IN EC2
![Page 25: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/25.jpg)
ELASTIC BEANSTALK TAKES CARE
OF THE ENVIRONMENT
![Page 26: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/26.jpg)
ADDING
ELASTIC LOAD BALANCER
![Page 27: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/27.jpg)
CONFIGURING
AUTO SCALING GROUP
![Page 28: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/28.jpg)
LAUNCHING
INSTANCE(S)
![Page 29: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/29.jpg)
ALL WIRED WITH
ELASTIC
BEANSTALK
![Page 30: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/30.jpg)
APPLICATION IS PUBLISHED
UNDER A CNAME
![Page 31: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/31.jpg)
WITH LOGS AND
APP VERSIONS
STORED
IN S3
![Page 32: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/32.jpg)
HOW
DO YOU CREATE
AN
APPLICATION
FOR
ELASTIC BEANSTALK ?
![Page 33: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/33.jpg)
LIKE
ANY
OTHER
APPLICATION
![Page 34: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/34.jpg)
Source uploaded and executed in AWS
Source downloaded
and executed locally NO DEPENDENCIES ON AWS
FOR BEANSTALK DEPLOYMENT
![Page 35: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/35.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/36.jpg)
CONSOLE DEPLOYMENTS
AND VERSION UPDATES
![Page 37: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/37.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/38.jpg)
ECLIPSE INTEGRATION
![Page 39: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/39.jpg)
VISUAL STUDIO INTEGRATION
![Page 40: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/40.jpg)
GIT INTEGRATION
![Page 41: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/41.jpg)
CONTAINER CONFIGURATION
![Page 42: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/42.jpg)
![Page 43: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/43.jpg)
“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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/44.jpg)
AWS Elastic
Beanstalk
AWS
OpsWorks AWS
CloudFormation
Amazon EC2
![Page 45: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/45.jpg)
AWS Elastic
Beanstalk
AWS
OpsWorks AWS
CloudFormation
Amazon EC2
CONVENIENCE CONTROL
![Page 46: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/46.jpg)
AWS Elastic
Beanstalk
AWS
OpsWorks AWS
CloudFormation
Amazon EC2
CONVENIENCE CONTROL
HIGH-LEVEL DO IT YOURSELF
![Page 47: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/47.jpg)
THERE IS
NO ADDITIONAL CHARGE
FOR USING
ELASTIC BEANSTALK
OPSWORKS
CLOUDFORMATION
![Page 48: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/48.jpg)
YOU PAY ONLY FOR THE
AWS RESOURCES
NEEDED TO
STORE AND RUN
YOUR
APPLICATIONS
![Page 49: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/49.jpg)
= PROGRAMMABLE
PLATFORM
![Page 50: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/50.jpg)
API | SDK | CLI
![Page 51: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/51.jpg)
API | SDK | CLI
![Page 52: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/52.jpg)
![Page 53: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/53.jpg)
![Page 54: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/54.jpg)
![Page 55: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/55.jpg)
![Page 56: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/56.jpg)
![Page 57: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/57.jpg)
![Page 58: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/58.jpg)
“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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/59.jpg)
![Page 60: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/60.jpg)
“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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/61.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/62.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/63.jpg)
AWS is a set of building blocks
![Page 64: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/64.jpg)
« 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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/65.jpg)
var AWS = require('aws-sdk');
sqs = new AWS.SQS();
![Page 66: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/66.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/67.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/68.jpg)
SCALABILITY
![Page 69: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/69.jpg)
SESSION DATA
SCALABILITY
OTHER DATA
![Page 70: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/70.jpg)
SESSION DATA
SCALABILITY
OTHER DATA
DynamoDB Redis
Memcached/ElastiCache …
DynamoDB MySQL/RDS
Redis …
![Page 71: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/71.jpg)
TIME FOR
A DEMO
![Page 72: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/72.jpg)
![Page 73: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/73.jpg)
A prototype shouldn't require big investments…
![Page 74: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/74.jpg)
…it should be cheap and validate ideas
![Page 75: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/75.jpg)
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](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/76.jpg)
INNOVATE
![Page 77: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/77.jpg)
« Want to increase innovation?
Lower the cost of failure »
Joi Ito
![Page 78: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/78.jpg)
http://aws.amazon.com/free
![Page 79: Programming Amazon Web Services](https://reader034.vdocuments.us/reader034/viewer/2022051818/54b6d5a14a7959703e8b4632/html5/thumbnails/79.jpg)