More Related Content
Similar to Getting Started with Serverless Architectures with Microservices_AWSPSSummit_Singapore
Similar to Getting Started with Serverless Architectures with Microservices_AWSPSSummit_Singapore (20)
More from Amazon Web Services
More from Amazon Web Services (20)
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_Singapore
- 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dennis Magsajo
Solutions Architect, Amazon Web Services
#<SESSION ID>
Getting Started with Serverless
Architectures with Microservices
- 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
No servers to provision
or manage
Scales with usage
Never pay for idle Availability and
fault-tolerance built in
Serverless means…
- 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Spectrum of AWS Serverless offerings
AWS
Lambda
Amazon Kinesis
Amazon
S3
Amazon API Gateway
Amazon
SQS
Amazon
DynamoDB
AWS IoT
Amazon Cognito
AWS Step
Functions
AWS Fargate
Amazon Aurora
Serverless
- 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices are …
Microservices advocate creating a system from a collection
of small, isolated services, each of which owns their data,
scalable and resilient to failure
- 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How does Serverless Relate to Microservices?
• The serverless approach aligns with microservices design
principles and best practices
• Some of them come out of the box
• Others are much easier to achieve that with traditional
approaches
• Serverless is not a silver bullet
• Let’s review each principle through a serverless lens …
- 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why Microservices?
Business Goals
Time-to-Market
The size and risk of change
reduces as the rate of change
increases, which enables greater
agility and faster time-to-market
Ownership
Teams act within a small and well-
understood bounded context and
are empowered to work
independently
Design Pillars
Resilience
Isolate failure and to improve the
overall availability
Scalability
Scale horizontally and
independently
Continuous Delivery
Changes are frequent and failures
are cheap
- 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resilience
- 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Things will fail, plan for it!
• Architect for high-availability
• Apply throttles
• Employ retries and set the right timeouts
- 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
High-availability
• Multi-region serverless application using Amazon API Gateway
and Amazon Route53 routing policies and latency based health-
checks
us-west-2
us-east-1
Client
Amazon
Route 53
Regional
API
Endpoint
Regional
API
Endpoint
Custom
Domain
Name
Custom
Domain
Name
API Gateway
API Gateway
Lambda
Lambda
api.mycorp.com
CNAME
CNAME
- 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
High-availability
• Set throttles to prevent your downstream APIs from being
overwhelmed by too many requests
• Create Amazon API Gateway usage plans for throttling and quota
- 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
High-availability
• AWS Lambda lets you set a timeout for your function
- 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Logging and Monitoring
Amazon CloudWatch AWS X-Ray
- 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scalability
- 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Serverless Storage
Defining the AWS data
lake
Data lake is an architecture with a virtually
limitless centralized storage platform capable
of categorization, processing, analysis, and
consumption of heterogeneous data sets
• Decoupled storage and
compute
• Rapid ingest and
transformation
• Secure multi-tenancy
• Query in place
• Schema on read
- 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Serverless Storage
Unmatched durability,
availability, and scalability
Best security, compliance, and audit
capability
Object-level control
at any scale
Business insight into
your data
Twice as many partner
integrations
Most ways to bring
data in
Reasons to choose Amazon S3 for data lake
- 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Serverless Storage
Amazon Aurora Serverless Amazon DynamoDB
• Fully managed
• Maintenance-
free
• Serverless
• Auto scaling
• Backup and
restore
• Global tables
- 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling Serverless Compute
CHANGING COMPUTE CONSUMPTION
MODEL
No instances
to manage
Task
native API
Resource
based pricing
Simple, easy to use,
powerful – and new
consumption model
=
- 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do your functions scale?
• AWS Lambda scales via container architecture … but you need
not worry about that
- 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Decoupled Scaling
Synchronous
(push)
Asynchronous
(event)
Stream-based
Amazon
API Gateway
AWS Lambda
function
Amazon
DynamoDBAmazon
SNS
/order
AWS Lambda
function
Amazon
S3
reqs
Amazon
Kinesis
changes
AWS Lambda
service
function
- 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous
Delivery
- 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is a good process?
q Easy to interpret
q Frequent and small changes
q Changes have scope impact
q Automated deployments
- 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is a good process?
q Easy to interpret
q Frequent and small changes
q Changes have scope impact
q Automated deployments
• Extension of AWS CloudFormation
• Automate deployment via AWS
CodePipeline
• Build, test, and debug locally via SAM
CLI
• Search and deploy serverless apps on
the AWS Serverless Application
Repository
AWS Serverless
Application
Model (SAM)
- 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is a good process?
q Easy to interpret
q Frequent and small changes
q Changes have scope impact
q Automated deployments • A CLI tool for local building, validating,
testing of serverless apps
• Works with Lambda functions and
“proxy-style” APIs
• Response object and function logs
available on your local machine
• Uses open source docker-lambda
images to mimic Lambda’s execution
environment:
• Emulates timeout, memory limits,
runtimes
AWS SAM
CLI
SAM Local
- 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is a good process?
q Easy to interpret
q Frequent and small changes
q Changes have scope impact
q Automated deployments
• Create “canary” deploys
• Do blue/green deployments between
versions
• Easily shift traffic between versions and see
different metrics and logs unique to each
• Test new functionality and roll back quickly
if necessary
Traffic Shifting in Lambda Aliases
# Update $LATEST version of function
aws lambda update-function-code --function-name myfunction ….
# Publish new version of function
aws lambda publish-version --function-name myfunction
# Point alias to new version, weighted at 5% (original version at 95% of traffic)
aws lambda update-alias --function-name myfunction --name myalias --routing-config '{"AdditionalVersionWeights" : {"2" : 0.05} }’
# Verify that the new version is healthy
…
# Set the primary version on the alias to the new version and reset the additional versions (100% weighted)
aws lambda update-alias --function-name myfunction --name myalias --function-version 2 --routing-config '{}'
- 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is a good process?
q Easy to interpret
q Frequent and small changes
q Changes have scope impact
q Automated deployments
• Start developing on AWS in
minutes
• Work across your team, securely
• Manage software delivery easily
• Choose from a variety of templates
AWS Code Services
AWS CodePipeline AWS CodeCommit AWS CodeBuildAWS CodeDeploy
AWS Code
Star
- 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Security and Identity
• User pools for secure, managed user
directories
• Identity pools for federation and role-
based access control
Amazon Cognito
• Fine-grained access control to AWS
resources
AWS Identity and Access
Management
- 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build PCI- and HIPAA-compliant serverless
applications!
Serverless platform services that can be used in both:
AWS
Lambda
Amazon
S3
Amazon
CloudFront
Amazon
DynamoDB
Amazon
Kinesis
Streams
Amazon
Cognito
Amazon API
Gateway
Amazon
SNS
- 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Common “Serverless” 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 and
services
• Mobile
• IoT
</></>
Amazon
Alexa
• Powering
voice-enabled
apps
• Alexa Skills
Kit
IT
automation
• Policy engines
• Extending
AWS services
• Infrastructure
management
- 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Bustle Achieves 84% Cost Savings with
AWS Lambda
Bustle is a news, entertainment, lifestyle, and fashion
website targeted towards women.
With AWS Lambda, we
eliminate the need to worry
about operations
Tyler Love
CTO, Bustle
”
“ • Bustle had trouble scaling and
maintaining high availability for its
website without heavy management
• Moved to serverless architecture using
AWS Lambda and Amazon API
Gateway
• Experienced approximately 84% in
cost savings
• Engineers are now focused on
innovation
- 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CU STOMERS LOVE SERVERLESS
- 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
https://aws.amazon.com/serverless
- 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!