3. <start>
It’s easier than ever to build web applications that are:
• Massively scalable
• Highly available and fault-tolerant
• Easily secured
• Cost-aligned with usage
Without:
• Managing a single server or container orchestration system
• Patching operating systems
• Monitoring operating system metrics to control scaling
6. Exploring a basic web application technology stack
InternetMobile/
Web apps
?Frontend
?Backend
?Database
7. Exploring a basic web application technology stack
InternetMobile/
Web apps
?Backend
?Database
?Frontend
8. Frontend servers
• Serve mostly static contents
• HTML
• CSS
• JavaScript
• Image, video, etc.
• Might generate dynamic contents with
languages like PHP
• Reactive Web Framework
• Non-blocking and event-driven
applications
• Using declarative approach
• With interface library and data request
capabilities
• Easier to support multiple platforms
PastPresent
9. Two options for serverless hosting of static content
Roll your own with Amazon Simple
Storage Service (Amazon S3)
Amazon S3
AWS Amplify CLI &
Amplify Console
AWS Amplify
10. Amazon S3
Amazon S3
• Can host static websites
• Supports fine-grained
permission control
• Acts as a logging endpoint for
Web services
• Supports encryption at transit and
at rest
• Lifecycle capabilities to rotate data
across tiers and even delete them
if needed
Amazon CloudFront
• Cache static content at the edge
for faster delivery
• Dynamic and static content
• Custom SSL certificates
• Low TTLs (as short as 0 seconds)
Responsetime
Serverload
Response
time
Server
load
Response
time
Server
load
No CDN CDN for
static content
CDN for static
and dynamic
content
11. AWS Amplify
makes it easy to create, configure, and implement
scalable mobile and web apps powered by AWS
• Framework
• Cloudservices
• Developertools
• Continuousdeployment
• Hosting
14. AWS Amplify
Hosting for static web applications
• Integrated with Git
• Built-in CI/CD workflows (supports Git branches)
• Host a friendly URL with CDN
• Support for auth controls
• Built-in rewrites and redirects of URL
• Deploy SPA with popular frontend frameworks such as Vue, Angular,
and React
AWS Amplify
18. To put it simply: Amazon API Gateway
makes it easy to host serverless APIs
19. Amazon API Gateway: Types of APIs
Amazon API Gateway
API Gateway
cache
Amazon
CloudWatch
monitoring
Fully managed
CloudFront
distribution
Edge-optimizedRegionalPrivate
Edge-optimized
• Utilizes CloudFront to
reduce TLS connection
overhead (reduces
roundtrip time)
• Designed for a globally
distributed set of clients
Regional
• Recommended API
type for general
use cases
• Designed for building
APIs for clients in the
same region
Private
• Only accessible
from within VPC
(and networks
connected to VPC)
• Designed for building
APIs used internally
or by private
microservices
AWS Lambda
functions
Any other
AWS service
20. Secure with your Amazon API Gateway
Several mechanisms for adding authorization/authentication
and restricting API access
• IAM permissions – use IAM policies and AWS credentials to
grant access
• Lambda authorizers – use Lambda to validate a bearer token
(e.g., OAuth or SAML) or request parameters and grant access
• Amazon Cognito user pools – create a completely managed
user management system
• Resource policies – can restrict based on IP, VPC, and AWS Account ID
23. Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
25. Smart resource allocation
Stats for Lambda function that calculates 1000 times all prime numbers
<= 1000000
128 MB 11.722965 sec $0.024628
256 MB 6.678945 sec $0.028035
512 MB 3.194954 sec $0.026830
1024 MB 1.465984 sec $0.024638
Best
Worst
Lambda exposes only a memory control, with the % of CPU core and network
capacity allocated to a function proportionally
Match resource allocation (up to 3 GB) to logic
26. Lambda permissions model
Function policies
• “Actions on bucket X can
invoke Lambda function Z"
• Resource policies allow
for cross-account access
• Used for sync and
async invocations
Execution role
• “Lambda function A can read from
DynamoDB table users”
• Define what AWS resources / API
calls this function can access
via IAM
• Used in streaming invocations
Event source ServicesFunction
30. Common data categories
Relational Key value Document In memory Graph Time series Ledger
Aurora, RDS DynamoDB Amazon
DocumentDB
ElastiCache Neptune Timestream QLDBAWS
Service(s)
31. Amazon DynamoDB
Fast and flexible NoSQL database service for any scale
Enterprise-ready
ACID transactions
Encryption at rest
On-demand backup and restore
Performance at scale
Handles millions of requests
per second
Delivers microsecond latency
Automated global replication
Serverless
Maintenance-free
Auto scaling
On-demand capacity mode
32. Why we choose DynamoDB?
All Amazon database services have:
• Easy scale controls + ability to handle massive scale
• High availability and durability
• Backup/restore capabilities
• Billing options that can scale with your business need
But in sticking with the theme of serverless, DynamoDB wins out:
• Pay-for-what-you-use billing
• Dynamic scaling without the need to preconfigure capacity
Again, most of this will depend on what your use case is
33. AWS Amplify
Exploring a basic web application technology stack
Amazon API
Gateway
AWS Lambda
Amazon
DynamoDB
Mobile/Web
apps
Internet
34. </end>
By combining these services, we can build a completely serverless
application stack
• No servers to manage
• Automatic scalability to handle most workloads
• High availability and fault tolerance out of the box
• Numerous security controls throughout the stack
• Aligned costs to consumption