1
Introduction To AWS & AWS
Lambda
2
Who am I?
An Nguyen
Email: nthienan.it@gmail.com
6+ years of experience in software industry
Java, Python developer, DevOps engineer
3
Agenda
 Amazon Web Services (AWS)
● Introduction cloud computing and AWS
● Core services
● Global infrastructure
● Shared Responsibility Model
● Free tier
 AWS Lambda
● What are Serverless and Lambda?
● Benefits of Lambda
● Development, testing, deployment
● Common use cases & limitation
 Demo
4
Amazon Web Services
5
Cloud computing
 The on-demand delivery of compute power,
database storage, applications, and other IT
resources through a cloud services platform via
the internet with pay-as-you-go pricing.
6
What is AWS?
 Amazon Web Services (AWS) is a cloud service from Amazon.
 The first of the major players to offer cloud services to the public in 2006
 The most popular enterprise cloud service
 AWS offers the largest range of services and features (2000+)
7
Core Services
8
AWS Global Infrastructure
Region & Number of Availability Zones
New Region
9
AWS Global Infrastructure
10
Why AZ is an important and foundational concept?
11
Why AZ is an important and foundational concept?
12
Shared Responsibility Model
13
AWS Free Tier
 12 months free
● EC2: 750 hours/month
● RDS: 750 hours/month
● EBS: 30 GB
● S3: 5 GB
● ELB: 750 hours/month
 Always free
● SES: 62,000 outbound messages/month
● SNS: 1 million requests/month
● DynamoDB: 25 GB of storage, 200 million requests/month
● Lambda: 1 million requests/month
More details: https://aws.amazon.com/free/
14
Lambda
15
Evolving to Serverless
16
What’s Serverless?
 Serverless computing is an architecture where code execution is fully
managed by a cloud provider.
 The name “serverless” instead highlights the fact that end users don’t have
to manage servers that run their code anymore
Traditional model
• How many servers?
• Storage requirements?
• Where’re the servers
located?
Serverless
Code and only code
17
AWS Lambda
Serverless, event-driven compute service
18
AWS Lambda (cont)
 Functions as the unit
of scale
 Run my code when it’s
needed
19
Benefits of Lambda
Provisioning
and Utilization
Operations and
Management
Scaling Availability and
Fault Tolerance
Low cost Simple Scalable Reliable
20
How to deploy a Lambda function?
Node.js & Python
• .zip file consisting of
your code and any
dependencies
• Use npm/pip to install
libraries
• All dependencies
must be root level
Java
• Either .zip file with all
code/dependencies or
standalone .jar
• Use Maven, Gradle,
IDE plugins
• Compiled class &
resources file at root
level, required jar in
/lib directory
C#
• Either .zip file with all
code/dependencies or
a standalone .dll
• Use Nutget,
VisualStudio plugins
• All assemblies (.dll) at
root level
21
Deployment tools and frameworks
CloudFormation
• AWS Serverless
Application Model –
extension optimized
for Serverless
• New Serverless
resources – APIs,
Functions, Tables
Chalice
• Python serverless
micro-framework
• Quickly create and
deploy applications
• Setup AWS Lambda
and Amazon API
Gateway endpoint
Third-party tools
• Serverless framework
(serverless.com)
• Apex Serverless
Architecture
(apex.run)
• …
22
Use cases
API backend Data processing Microservice
IoT Event processing Mobile backend
23
Limitation
 The disk space is limited to 512 MB,
 Memory can vary from 128 to 1536 MB
 The execution timeout for a function is maximum in 5 minutes
 No in-server state (stateless only)
 Size of deployment package is limited to 50 MB
 Concurrent executions is 100 (can request service limit increase)
24
Demo
25
Web application architecture without Lambda
26
Web application architecture with Lambda
27
Demo
28
Q&A
29
References
 AWS free tier: https://aws.amazon.com/free
 Shared responsibility model: https://aws.amazon.com/compliance/shared-
responsibility-model/
 Lambda: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
 API Gateway:
http://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html
 S3: https://aws.amazon.com/s3/
 Chalice: http://chalice.readthedocs.io/en/latest/
 Demo code: https://github.com/nthienan/aws-music-manager
30
Thank You!

Introduction To AWS & AWS Lambda

  • 1.
  • 2.
    2 Who am I? AnNguyen Email: nthienan.it@gmail.com 6+ years of experience in software industry Java, Python developer, DevOps engineer
  • 3.
    3 Agenda  Amazon WebServices (AWS) ● Introduction cloud computing and AWS ● Core services ● Global infrastructure ● Shared Responsibility Model ● Free tier  AWS Lambda ● What are Serverless and Lambda? ● Benefits of Lambda ● Development, testing, deployment ● Common use cases & limitation  Demo
  • 4.
  • 5.
    5 Cloud computing  Theon-demand delivery of compute power, database storage, applications, and other IT resources through a cloud services platform via the internet with pay-as-you-go pricing.
  • 6.
    6 What is AWS? Amazon Web Services (AWS) is a cloud service from Amazon.  The first of the major players to offer cloud services to the public in 2006  The most popular enterprise cloud service  AWS offers the largest range of services and features (2000+)
  • 7.
  • 8.
    8 AWS Global Infrastructure Region& Number of Availability Zones New Region
  • 9.
  • 10.
    10 Why AZ isan important and foundational concept?
  • 11.
    11 Why AZ isan important and foundational concept?
  • 12.
  • 13.
    13 AWS Free Tier 12 months free ● EC2: 750 hours/month ● RDS: 750 hours/month ● EBS: 30 GB ● S3: 5 GB ● ELB: 750 hours/month  Always free ● SES: 62,000 outbound messages/month ● SNS: 1 million requests/month ● DynamoDB: 25 GB of storage, 200 million requests/month ● Lambda: 1 million requests/month More details: https://aws.amazon.com/free/
  • 14.
  • 15.
  • 16.
    16 What’s Serverless?  Serverlesscomputing is an architecture where code execution is fully managed by a cloud provider.  The name “serverless” instead highlights the fact that end users don’t have to manage servers that run their code anymore Traditional model • How many servers? • Storage requirements? • Where’re the servers located? Serverless Code and only code
  • 17.
  • 18.
    18 AWS Lambda (cont) Functions as the unit of scale  Run my code when it’s needed
  • 19.
    19 Benefits of Lambda Provisioning andUtilization Operations and Management Scaling Availability and Fault Tolerance Low cost Simple Scalable Reliable
  • 20.
    20 How to deploya Lambda function? Node.js & Python • .zip file consisting of your code and any dependencies • Use npm/pip to install libraries • All dependencies must be root level Java • Either .zip file with all code/dependencies or standalone .jar • Use Maven, Gradle, IDE plugins • Compiled class & resources file at root level, required jar in /lib directory C# • Either .zip file with all code/dependencies or a standalone .dll • Use Nutget, VisualStudio plugins • All assemblies (.dll) at root level
  • 21.
    21 Deployment tools andframeworks CloudFormation • AWS Serverless Application Model – extension optimized for Serverless • New Serverless resources – APIs, Functions, Tables Chalice • Python serverless micro-framework • Quickly create and deploy applications • Setup AWS Lambda and Amazon API Gateway endpoint Third-party tools • Serverless framework (serverless.com) • Apex Serverless Architecture (apex.run) • …
  • 22.
    22 Use cases API backendData processing Microservice IoT Event processing Mobile backend
  • 23.
    23 Limitation  The diskspace is limited to 512 MB,  Memory can vary from 128 to 1536 MB  The execution timeout for a function is maximum in 5 minutes  No in-server state (stateless only)  Size of deployment package is limited to 50 MB  Concurrent executions is 100 (can request service limit increase)
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
    29 References  AWS freetier: https://aws.amazon.com/free  Shared responsibility model: https://aws.amazon.com/compliance/shared- responsibility-model/  Lambda: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html  API Gateway: http://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html  S3: https://aws.amazon.com/s3/  Chalice: http://chalice.readthedocs.io/en/latest/  Demo code: https://github.com/nthienan/aws-music-manager
  • 30.

Editor's Notes

  • #7 services across compute, storage, database, analytics, networking, mobile, developer tools, management tools, IoT, security, ect…
  • #9 55 Availability Zones within 18 geographic Regions and 1 Local Region around the world https://aws.amazon.com/about-aws/global-infrastructure/
  • #10 An AWS Region is a geographical location. Every region is physically isolated from and independent of every other region in terms of location, power, water supply, etc An availability zone is a logical data center in a region. Each zone in a region has redundant and separate power, networking and connectivity to reduce the likelihood of two zones failing simultaneously
  • #11 A typical three-tier application running in a user’s single on-premises data center may look like. While there are redundant servers running in each tier, the data center itself is a single point of failure
  • #12 The diagram below illustrates the recommended practice of spanning an application across multiple zones
  • #13 - AWS is responsible for protecting the infrastructure that runs all of the services offered in the AWS Cloud. This infrastructure is composed of the hardware, software, networking, and facilities that run AWS Cloud services - Customer responsibility will be determined by the AWS Cloud services that a customer selects
  • #16 The evolution steps of application deployment went from physical (having servers in its own protected room in a company and taking care of its maintenance) to virtualization to cloud, then containers (Docker), all the way to serverless, where basically you don’t exactly know in which context the application is deployed
  • #17 It means developers don't have to worry about managing, provisioning and maintaining servers when deploying code.
  • #18 Lambda is a compute service from the cloud vendor AWS that lets you do just this: run code without provisioning or managing servers. Developers can focus on their code and event triggers and AWS takes care of the rest. So in very simple terms you have code and events, when the event arrives the code is executed for you automatically. So you don’t have to pre-position resources or have any standing infrastructure to provide the execution environment. AWS Lambda service was launched in 2014
  • #20 AWS Lambda lets you run code without provisioning or managing servers There is no charge when your code is not running Run code for virtually any type of application or backend service with zero administration Supported Languages: Java, Python, Node.js, C#. Provides an opportunity for developers to deploy their applications in minutes instead of days or months $0.20 PER 1M REQUESTS
  • #23 Stateless processing of discrete or streaming update to your data store or message bus Execute server side backend logic for web, mobile, IoT, device, or voice user interactions
  • #28 http://nthienan.com.s3-website-ap-southeast-1.amazonaws.com https://github.com/nthienan/aws-music-manager
  • #29 Other cloud providers? (Google Cloud Platform, Microsoft Azure, IBM Cloud, Red Hat Cloud Suite) Other Serverless services? (Google: Cloud functions, Microsoft: Azure functions, IBM: Cloud functions)