4. AWS compute offerings
VM Task Function
Service Elastic Compute
Cloud (EC2)
EC2 Container
Service (ECS)
Lambda
H/W OS Runtime
Unit of scale
Level of
abstraction
5. AWS compute offerings
I want to
configure
servers,
storage,
networking,
and my OS
I want to run
servers,
configure
applications,
and control
scaling
Run my
code when
it’s needed
Service
How do I
choose?
Elastic Compute
Cloud (EC2)
EC2 Container
Service (ECS)
Lambda
6. Servers
How will the application
handle server hardware failure?
How can I control
access from my servers?
When should I decide to
scale out my servers?
When should I decide to
scale up my servers?
What size servers are
right for my budget?
How much remaining
capacity do my servers have?
(AAHHHHHHHHH!!)
7. Operations and management Scaling
Provisioning and utilization Availability and fault tolerance
Owning servers means dealing with ...
8. AWS Lambda: Run code in response to events
FUNCTION
Changes in
data state
Requests to
endpoints
Changes in
resource state
NodeJS
Python
Java
C#
EVENT SOURCE
2 + 2 = 4
9. No servers to provision
or manage
Scales with usage
Never pay for idle Availability and fault
tolerance built in
Benefits of Lambda and serverless compute
11. Using AWS Lambda
Bring your own code
• Node.js, Java, Python,
C#
• Bring your own libraries
(even native ones)
Flexible authorization
• Securely grant access to
resources and VPCs
• Fine-grained control for
invoking your functions
Authoring functions
• WYSIWYG editor or
upload packaged .zip
• Third-party plugins
(Eclipse, Visual Studio)
Simple resource model
• Select power rating from
128 MB to 1.5 GB
• CPU and network
allocated proportionately
12. Using AWS Lambda
Monitoring and logging
• Metrics for requests,
errors, and throttles
• Built-in logs to Amazon
CloudWatch Logs
Programming model
• Use processes, threads,
/tmp, sockets normally
• AWS SDK built in
(Python and Node.js)
Stateless
• Persist data using
external storage
• No affinity or access to
underlying infrastructure
Flexible use
• Synchronous or
asynchronous
• Integrated with other
AWS services
13. Amazon S3 Amazon
DynamoDB
Amazon
Kinesis
AWS
CloudFormation
AWS CloudTrail Amazon
CloudWatch
Amazon
Cognito
Amazon SNSAmazon
SES
Cron events
DATA STORES ENDPOINTS
CONFIGURATION REPOSITORIES EVENT/MESSAGE SERVICES
Example event sources that trigger AWS Lambda
… and a few more with more on the way!
AWS
CodeCommit
Amazon
API Gateway
Amazon
Alexa
AWS IoT AWS Step
Functions
14. AWS Lambda
Amazon DynamoDB
Amazon SNS
Amazon API Gateway
Amazon SQS
Amazon KinesisAmazon S3
Serverless Compute and API Proxy
AWS X-Ray
AWS Step Functions
Services for Building Serverless Applications
Database, Storage, State Management, Analytics, Messaging & Queues
Developer Tools
AWS CodeBuild
AWS CodePipelineAWS SAM
Third-Party Tools
Open Source
16. Amazon API Gateway: Serverless APIs
Internet
Mobile Apps
Websites
Services
AWS Lambda
functions
API Gateway
Cache
Endpoints on
Amazon EC2
All publicly
accessible
endpoints
Amazon
CloudWatch
Monitoring
Amazon
CloudFront
Amazon
API Gateway
Any other
AWS service
17. Amazon API Gateway Benefits
Create a unified API
frontend for multiple
microservices
DDoS protection
and throttling for
backend systems
Authenticate and
authorize requests
18. “I want to sequence functions”
“I want to select functions based on data”
“I want to run functions in parallel”
“I want to retry functions”
“I want to try/catch/finally”
“I want to run code for hours”
Orchestration for serverless apps
AWS Step Functions
20. AWS Step Functions
Easily coordinate multiple Lambda functions using visual workflows
Visualize in the
Console
Define in JSON Monitor
Executions
21. Benefits of Step Functions orchestration
Change and add steps
without writing code to
evolve applications
and innovate faster
Coordinate and visualize
Lambda functions as a
series of steps to quickly
create serverless apps
Automatically trigger and
track each step at scale
and handle errors with
built-in retry and fallback
Productivity AgilityResilience
23. AWS CloudFormation brings:
• Infrastructure as code
• Easy to provision and manage a collection of related AWS resources
• Input .yaml file and output provisioned AWS resources
• Optimized for infrastructure
AWS SAM:
• CloudFormation extension optimized for serverless
• New serverless resources: functions, APIs, and tables
• Supports anything CloudFormation supports
• Open specification (Apache 2.0)
AWS Serverless Application Model (AWS SAM)
32. Common use cases
Web
Applications
• Static
websites
• Complex web
apps
• Packages for
Flask and
Express
Data
Processing
• Real time
• MapReduce
• Batch
Chatbots
• Powering
chatbot logic
Backends
• Apps &
services
• Mobile
• IoT
</></>
Amazon
Alexa
• Powering
voice-enabled
apps
• Alexa Skills
Kit
IT
Automation
• Policy engines
• Extending
AWS services
• Infrastructure
management
33. AWS Summit Milan – 8 June 2017
PhotoVogue
Marco Viganò - Head of Digital Development
Paolo Latella - Principal Solutions Architect
AWS Summit Milan
8 June 2017
34. AWS Summit Milan – 8 June 2017
Who is Condé Nast?
1 M 10 M
Month
Daily average
220 M22 M
Page ViewsUU
Social 55%
SEO 30%
Mobile 75%
Desktop 19%
35. AWS Summit Milan – 8 June 2017
PhotoVogue
• Photography platform part of Vogue Italy
• Photographers around the world are able
to showcase their work
• > 130,000 photographers
more than 400,000 photos
image size up to 50 Mb
36. AWS Summit Milan – 8 June 2017
The Challenge
1. PV was launched in 2011: needs new UI/UX and to be re-engineered
2. Photos and users growing by the day: old legacy IT infrastructure wasn’t able
to manage the website traffic
3. We need to provision resources quickly: problems in scaling
4. We wanted to give both photographers and editorial staff a better, faster
experience
5. Problems with large file upload
38. AWS Summit Milan – 8 June 2017
How you are using AWS
• REST API for Admin and Editor built with AWS Lambda
• Client consumes REST API using AWS API Gateway.
• Users can upload their photos by leveraging S3 Pre-Signed URLs.
• AWS S3 triggers an AWS Lambda function for photos transformation.
• Amazon RDS is used as the database service.
• AWS CloudFront is used as a CDN for the photos.
40. AWS Summit Milan – 8 June 2017
The Benefits with AWS
1. Quicker provisioning of resources: from days to hours
2. No scaling problem due to traffic boost
3. Cost saving: cut 30% in comparison to the old infrastructure
4. Enabling innovation: Devs / DevOps, are now focused on innovation not on
manage old infrastructure survival
5. UX 90% faster: photographer and editorial team now have an excellent
experience
41. AWS Summit Milan – 8 June 2017
1. Making better Lambda logging with the help of CloudWatch
Alarm
2. Moving some Lambda on Edge: Lambda@Edge
3. RDS: Moving from MySQL to Aurora
4. Adoption of Serveless Ecosystem: moving other website
components on Lambda
Next AWS development
42. AWS Summit Milan – 8 June 2017
Thank You
Marco Viganò
@Sasha0423
Paolo Latella
@LatellaPaolo
43. Takeaways
• Many applications can go serverless
• Data processing, back ends, triggers
• What are the services/tool available for serverless
solutions
• Lambda, API Gateway, Managed services, etc…
• The ecosystem continues to grow
• Tooling, languages, and application capabilities
45. Next steps
1. Go to console.aws.amazon.com/lambda and create your first
Lambda function
2. Stay up to date with AWS Lambda on the Compute blog and check
out aws.amazon.com/lambda for scenarios and customer stories.
3. See https://aws.amazon.com/serverless for reference
architectures, samples, and links to more content.
4. Send us your questions, comments, and feedback on the AWS
Lambda Forums.
46. Conclusion
Lambda is a fundamental
component of modern
application architectures
It has a place in everything
from data processing to
simple web apps