SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
D a v i d N a s i , S r . P r o d u c t M a n a g e r , A W S
N i k K h i l n a n i S r . D i r e c t o r , P l a t f o r m , N a t i o n a l G e o g r a p h i c
P a r t n e r s
N o v e m b e r , 2 0 1 7
S R V 3 1 0
AWS re:INVENT
Designing Microservices with
Serverless
© 2017, 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Business Goals
Time-to-market
The size and risk of change reduces 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
WHY MICROSERVICES?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HOW SERVERLESS RELATES TO MICROSERVICES?
• The serverless approach aligns with the microservices
design principles and best practices
• Some of them come out of the box
• Others are much easier to achieve than with
traditional approaches
• Serverless is not a silver bullet
• Let’s review each principle through a serverless lens…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RESILIENCE
© 2017, 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HIGH-AVAILABILITY
• AWS Lambda is designed to use replication and redundancy to
provide high availability
• Keep your microservices regionalized for additional resiliency
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MULTI-REGION SERVERLESS APPLICATION
us-east-1
us-west-2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HealthcheckRegion1:
Type: "AWS::Route53::HealthCheck"
Properties:
HealthCheckConfig:
Port: "443"
Type: "HTTPS_STR_MATCH"
SearchString: "ok"
ResourcePath: "/prod/healthcheck"
FullyQualifiedDomainName: !Ref Region1HealthEndpoint
LATENCY-BASED HEALTH CHECK
If the health-check endpoint is not healthy, Amazon Route 53 selects the latency
record with the next best latency
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THROTTLING
Frontend service
Frontend
API
express()
Inventory service
Account service
Shipping service
Set throttles to prevent your downstream APIs from being overwhelmed by
too many requests
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Manage API keys
• Measure steady state rates
• Measure burst rates
• For each method
• Identify
• Adjust
ClientBackend
HARD PROBLEM TO SOLVE
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
USAGE PLANS IN API GATEWAY
Create usage plans to control:
• Throttling—overall request rate
(average requests per second)
and a burst capacity
• Quota—number of requests that
can be made per day, week, or
month
• API/stages—the API and API
stages that can be accessed
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
USE AWS X-RAY TO DEBUG THROTTLE ERRORS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SET TIMEOUTS AND RETRIES
• In event-based architecture with many downstream calls, timeouts and
retries are important to get right
• Have no timeouts at all, and a downstream API being down could hang
your whole microservice
• Log when timeouts occur, look at what happens, and change them
accordingly
• Limit number of retries and employ exponential backoff to avoid
resource exhaustion and backlog
• Duplicates may happen; code should be idempotent
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EASIER IN A SERVERLESS WORLD
• Lambda lets you set a timeout for your function
• Use synchronous execution when response is needed
• The invoking application receives a 429 error and is responsible
for retries
• Use asynchronous execution when no response is needed
• Messages are queued until executed
• Automatic retries with exponential backoff
• Dead Letter Queue (DLQ) for failed events
• Create and enable one DLQ per function—SQS or SNS
• When unable to send error to configured DLQ, DLQ Errors metric
will be updated
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
USE STEP FUNCTIONS FOR ADVANCED
ORCHESTRATION
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scalability
HOW DO YOUR FUNCTIONS SCALE?
Yes No
Is there an active container
available for this Lambda
function that isn’t busy
processing another event?
Active Function Containers
(Warm)
New Function Container
(Cold)
AWS
Lambda
AWS Lambda
Code Store
After new function container is started:
• Deployment package is downloaded
• Lambda runtime environment is initialized
Event
Start your
code
COLD START: UNDERSTAND THE FUNCTI ON LI FECYCLE
Cold start
Download
your code
Start new
container
AWS optimization Your optimization
Warm start
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
C OLD ST AR T : SI MPLI FY AND MI NI MI ZE DEPENDENC I ES
• Minimize your deployment package size
• Leverage modularity of the AWS SDK for Java and .NET
• Reduce the complexity of your dependencies
WARM START: LEVERAGE CONTAINER REUSE
• Lazily load variables in the global scope—functions stay
warm for several minutes
•Don’t load it if you don’t need it every time
s3 = boto3.resource('s3')
db = db.connect()
def lambda_handler(event, context):
global db
# verify if still connected
# otherwise carry on
if not db:
db = db.connect()
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Continuous
Delivery
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT IS A GOOD PROCESS?
Easy to interpret
Frequent and small changes
Changes have scoped impact
Automated deployments
AWS SERVERLESS APPLICATION MODEL (SAM)
AWS CloudFormation extension optimized for
serverless
New serverless resource types: functions, APIs,
and tables
Supports anything CloudFormation supports
Open specification (Apache 2.0)
https://github.com/awslabs/serverless-application-model
SAM TEMPLATE
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs4.3
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
Tells CloudFormation this is a SAM
template it needs to “transform”
Creates a Lambda function with the
referenced managed IAM policy,
runtime, code at the referenced zip
location, and handler as defined.
Also creates an API Gateway and
takes care of all
mapping/permissions necessary
Creates a DynamoDB table with five
Read and Write units
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT’S A GOOD PROCESS?
Easy to interpret
Frequent and small changes
Changes have scoped impact
Automated deployments
✔
SAM LOCAL
CLI tool for local 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 the Lambda execution environment:
• Emulates timeout, memory limits, runtimes
https://github.com/awslabs/aws-sam-local
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT’S A GOOD PROCESS?
Easy to interpret
Frequent and small changes
Changes have scoped impact
Automated deployments
✔
✔
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TRAFFIC SHIFTING IN LAMBDA ALIASES
Apply a “weight” to Lambda function aliases to shift
traffic between two versions of your function!
• 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
AWS LAMBDA—TRAFFIC SHIFTING IN THE CLI
# 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} }'
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT’S A GOOD PROCESS?
Easy to interpret
Frequent and small changes
Changes have scoped impact
Automated deployments
✔
✔
✔
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DELIVERY VIA CODEPIPELINE
Pipeline flow:
1. Commit your code to a source code repository
2. Package/test in AWS CodeBuild
3. Use CloudFormation actions in AWS CodePipeline
to create or update stacks via SAM templates
Optional: make use of ChangeSets
4. Make use of specific stage/environment parameter
files to pass in Lambda variables
5. Test our application between stages/environments
Optional: make use of Manual Approvals
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT’S A GOOD PROCESS?
Easy to interpret
Frequent and small changes
Changes have scoped impact
Automated deployments
✔
✔
✔
✔
BRINGING IT ALL TOGETHER
Resilience
Scalability
Continuous
Delivery
• Built-in resiliency and high availability
• Orchestration available inside and outside of your code
• Scales automatically
• Pay only for work done
• Easy to model and reason about deployments
• Think pure business logic
• Can now test locally
• Automated process helps deliver frequently and safely
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
NIK KHILNANI
SR. DIRECTOR, PLATFORM DEVELOPMENT
NATIONAL GEOGRAPHIC PARTNERS
nik.khilnani@natgeo.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Products
• TV channels
• Magazines and articles
• Travel and eCommerce
• Kids and live events
• And more
Reach
• Content engagement: 6.4 billion/month
• Households: 485 million
• Social followers: 396 million
• Countries: 172, languages: 43
• Proceeds returned to the non-profit
National Geographic Society: 27%
Technology
• Strong emphasis on security
• Independent regional systems
• Heterogeneous system architectures
• Re-platform in progress
• Expanding internationally
NATIONAL GEOGRAPHIC | FURTHER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RE-PLATFORM | EXPANSION
US Data Centers
Multi-Region
Global
Decommission
New Development
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE “NATGEO1” MOBILE APP
Localized
• Mobile native application launched in Australia
• Exclusive to Optus, Australia’s second largest telecom
• App specific premium content
Content
• Content spans full history of Nat Geo—1888 onwards
• Short-form (clips) and long-form (VOD, Live) video
• International magazine and article content
• Social content from Instagram
Personalized experience
• Content adapts to user activity
• Push notifications
• iOS and Android, with video casting
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
APPLICATION ARCHITECTURE
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CONTENT AGGREGATION
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ASYNCHRONOUS PROCESSING
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CONTENT DELIVERY
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PERSONALIZATION
Goal
• Serve engaging and relevant content to our users
• Display new content on repeat visits
• Bring the user back to the application
Lessons learned
• Auto Scaling gave Amazon CloudSearch an edge
over Amazon Elasticsearch
• Amazon SNS push notifications are very reliable
• Pay attention to push notification UX
• Use Step Functions and Simple Workflow to limit
Lambda state management in code
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IMAGE CLASSIFICATION
Goal
• Display images within sections of
the application without human
involvement
Lessons learned
• Plan for service limits early
• Review synchronous versus
asynchronous behavior of Amazon
Rekognition
• Review classification in relation to
larger context of image use
• Lambda managing Lambda is tricky
Labels Confidence
Arctic 98.9
Glacier 98.9
Ice 98.9
Mountain 98.9
Outdoors 98.9
Snow 98.9
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PERFORMANCE
Goal
• Performant microservices
• Low operational overhead
Lessons learned
• Really understand service nuances
• Understand cold starts/container lifecycle
• Lambda execution consistent across spikes
• Amazon API Gateway adds minimal overhead
• Design with read/write capacity in mind
• Amazon DynamoDB performance is very good
Lambda Invocation Duration API Gateway Overhead
DynamoDB Performance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT’S NEXT
Additional AWS services
• Step Functions—launched after development started
• Machine learning—take personalization further
Technology improvements
• International expansion
• Continued emphasis on security
• Alignment to 21st Century Fox strategy
• Multi-tenancy and vendor abstractions
Operations and monitoring
• Additional custom metrics
• Improve log analytics
• Infrastructure and application automation
Amazon
Kinesis
Amazon Machine
Learning
AWS Step
Functions
AWS
Glue
AWS
CloudFormation
AWS Certificate
Manager
AWS KMS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
High availability
• Continuous scaling
• Concurrency
• Resilience
• Predictability
Batteries included
• Security
• Managed services
• Continuous delivery
Increased productivity
• Self-service
• Empowered developers
• Increased reuse
• Focus on feature development
Easier innovation
• From on-premises to serverless
• Image classification
Reduced time-to-market
• Aggressive fixed launch date
• Coordinated launch between
Nat Geo and Optus telecom
Cost effective
• Pay for what you use
• Reduced financial risk
SERVERLESS BENEFITS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

Contenu connexe

Tendances

LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfAmazon Web Services
 
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...Amazon Web Services
 
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...Amazon Web Services
 
IOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTIOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTAmazon Web Services
 
CON320_Monitoring, Logging and Debugging Containerized Services
CON320_Monitoring, Logging and Debugging Containerized ServicesCON320_Monitoring, Logging and Debugging Containerized Services
CON320_Monitoring, Logging and Debugging Containerized ServicesAmazon Web Services
 
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...Amazon Web Services
 
CON318_Interstella 8888 Monolith to Microservices with Amazon ECS
CON318_Interstella 8888 Monolith to Microservices with Amazon ECSCON318_Interstella 8888 Monolith to Microservices with Amazon ECS
CON318_Interstella 8888 Monolith to Microservices with Amazon ECSAmazon Web Services
 
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017Amazon Web Services
 
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...Amazon Web Services
 
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoT
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoTIOT308-One Message to a Million Things Done in 60 seconds with AWS IoT
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoTAmazon Web Services
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Amazon Web Services
 
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...Amazon Web Services
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAmazon Web Services
 
Create a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformCreate a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformAmazon Web Services
 
WIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesWIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesAmazon Web Services
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSAmazon Web Services
 
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017Amazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 

Tendances (20)

LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...
Advanced Patterns in Microservices Implementation with Amazon ECS - CON402 - ...
 
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
 
IOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoTIOT203_Getting Started with AWS IoT
IOT203_Getting Started with AWS IoT
 
CON320_Monitoring, Logging and Debugging Containerized Services
CON320_Monitoring, Logging and Debugging Containerized ServicesCON320_Monitoring, Logging and Debugging Containerized Services
CON320_Monitoring, Logging and Debugging Containerized Services
 
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
 
CON318_Interstella 8888 Monolith to Microservices with Amazon ECS
CON318_Interstella 8888 Monolith to Microservices with Amazon ECSCON318_Interstella 8888 Monolith to Microservices with Amazon ECS
CON318_Interstella 8888 Monolith to Microservices with Amazon ECS
 
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017
NEW LAUNCH! AWS Serverless Application Repository - SRV215 - re:Invent 2017
 
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...
Successfully Migrating Business-Critical Applications to AWS - ENT401 - re:In...
 
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoT
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoTIOT308-One Message to a Million Things Done in 60 seconds with AWS IoT
IOT308-One Message to a Million Things Done in 60 seconds with AWS IoT
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...
Dow Jones & Wall Street Journal's journey to manage traffic spikes while miti...
 
Serverless DevOps to the Rescue
Serverless DevOps to the RescueServerless DevOps to the Rescue
Serverless DevOps to the Rescue
 
GPSTEC325-Enterprise Storage
GPSTEC325-Enterprise StorageGPSTEC325-Enterprise Storage
GPSTEC325-Enterprise Storage
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Create a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformCreate a Serverless Image Processing Platform
Create a Serverless Image Processing Platform
 
WIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesWIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS Services
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017
Best Practices for Orchestrating AWS Lambda Workloads - SRV335 - re:Invent 2017
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 

Similaire à SRV310_Designing Microservices with Serverless

Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...
Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...
Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...Amazon Web Services
 
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...Amazon Web Services
 
Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Amazon Web Services
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Amazon Web Services
 
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWS
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWSGPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWS
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWSAmazon Web Services
 
SRV313_Building Resilient, Multi-Region Serverless Applications
SRV313_Building Resilient, Multi-Region Serverless ApplicationsSRV313_Building Resilient, Multi-Region Serverless Applications
SRV313_Building Resilient, Multi-Region Serverless ApplicationsAmazon Web Services
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWSAdrian Hornsby
 
Design, Build, and Modernize Your Web Applications with AWS
 Design, Build, and Modernize Your Web Applications with AWS Design, Build, and Modernize Your Web Applications with AWS
Design, Build, and Modernize Your Web Applications with AWSDonnie Prakoso
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing Rushi Namani
 
Security at Scale with AWS - AWS Summit Cape Town 2017
Security at Scale with AWS - AWS Summit Cape Town 2017 Security at Scale with AWS - AWS Summit Cape Town 2017
Security at Scale with AWS - AWS Summit Cape Town 2017 Amazon Web Services
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Amazon Web Services
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAmazon Web Services
 
GPSTEC320_Paving the yellow brick road to the cloud
GPSTEC320_Paving the yellow brick road to the cloudGPSTEC320_Paving the yellow brick road to the cloud
GPSTEC320_Paving the yellow brick road to the cloudAmazon Web Services
 
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017Automating DDoS Response in the Cloud - SID324 - re:Invent 2017
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017Amazon Web Services
 
Learn how to build serverless applications using the AWS Serverless Platform-...
Learn how to build serverless applications using the AWS Serverless Platform-...Learn how to build serverless applications using the AWS Serverless Platform-...
Learn how to build serverless applications using the AWS Serverless Platform-...Amazon Web Services
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Amazon Web Services
 
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL MeetupIntroduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL MeetupBoaz Ziniman
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsAmazon Web Services
 
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017Amazon Web Services
 

Similaire à SRV310_Designing Microservices with Serverless (20)

Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...
Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...
Healthcare Payers and Serverless Batch Processing Engines - HLC308 - re:Inven...
 
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...
Strategies for Migrating Microsoft SQL Databases to AWS - WIN314 - re:Invent ...
 
Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
 
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWS
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWSGPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWS
GPSWKS407-Strategies for Migrating Microsoft SQL Databases to AWS
 
SRV313_Building Resilient, Multi-Region Serverless Applications
SRV313_Building Resilient, Multi-Region Serverless ApplicationsSRV313_Building Resilient, Multi-Region Serverless Applications
SRV313_Building Resilient, Multi-Region Serverless Applications
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWS
 
Design, Build, and Modernize Your Web Applications with AWS
 Design, Build, and Modernize Your Web Applications with AWS Design, Build, and Modernize Your Web Applications with AWS
Design, Build, and Modernize Your Web Applications with AWS
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing
 
Security at Scale with AWS - AWS Summit Cape Town 2017
Security at Scale with AWS - AWS Summit Cape Town 2017 Security at Scale with AWS - AWS Summit Cape Town 2017
Security at Scale with AWS - AWS Summit Cape Town 2017
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
 
GPSTEC320_Paving the yellow brick road to the cloud
GPSTEC320_Paving the yellow brick road to the cloudGPSTEC320_Paving the yellow brick road to the cloud
GPSTEC320_Paving the yellow brick road to the cloud
 
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017Automating DDoS Response in the Cloud - SID324 - re:Invent 2017
Automating DDoS Response in the Cloud - SID324 - re:Invent 2017
 
Learn how to build serverless applications using the AWS Serverless Platform-...
Learn how to build serverless applications using the AWS Serverless Platform-...Learn how to build serverless applications using the AWS Serverless Platform-...
Learn how to build serverless applications using the AWS Serverless Platform-...
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
 
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL MeetupIntroduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
 
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017
Oracle Enterprise Solutions on AWS - ENT326 - re:Invent 2017
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 

Plus de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

SRV310_Designing Microservices with Serverless

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. D a v i d N a s i , S r . P r o d u c t M a n a g e r , A W S N i k K h i l n a n i S r . D i r e c t o r , P l a t f o r m , N a t i o n a l G e o g r a p h i c P a r t n e r s N o v e m b e r , 2 0 1 7 S R V 3 1 0 AWS re:INVENT Designing Microservices with Serverless
  • 2. © 2017, 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
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Business Goals Time-to-market The size and risk of change reduces 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 WHY MICROSERVICES?
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. HOW SERVERLESS RELATES TO MICROSERVICES? • The serverless approach aligns with the microservices design principles and best practices • Some of them come out of the box • Others are much easier to achieve than with traditional approaches • Serverless is not a silver bullet • Let’s review each principle through a serverless lens…
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RESILIENCE
  • 6. © 2017, 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
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. HIGH-AVAILABILITY • AWS Lambda is designed to use replication and redundancy to provide high availability • Keep your microservices regionalized for additional resiliency
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MULTI-REGION SERVERLESS APPLICATION us-east-1 us-west-2
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. HealthcheckRegion1: Type: "AWS::Route53::HealthCheck" Properties: HealthCheckConfig: Port: "443" Type: "HTTPS_STR_MATCH" SearchString: "ok" ResourcePath: "/prod/healthcheck" FullyQualifiedDomainName: !Ref Region1HealthEndpoint LATENCY-BASED HEALTH CHECK If the health-check endpoint is not healthy, Amazon Route 53 selects the latency record with the next best latency
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THROTTLING Frontend service Frontend API express() Inventory service Account service Shipping service Set throttles to prevent your downstream APIs from being overwhelmed by too many requests
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Manage API keys • Measure steady state rates • Measure burst rates • For each method • Identify • Adjust ClientBackend HARD PROBLEM TO SOLVE
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. USAGE PLANS IN API GATEWAY Create usage plans to control: • Throttling—overall request rate (average requests per second) and a burst capacity • Quota—number of requests that can be made per day, week, or month • API/stages—the API and API stages that can be accessed
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. USE AWS X-RAY TO DEBUG THROTTLE ERRORS
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SET TIMEOUTS AND RETRIES • In event-based architecture with many downstream calls, timeouts and retries are important to get right • Have no timeouts at all, and a downstream API being down could hang your whole microservice • Log when timeouts occur, look at what happens, and change them accordingly • Limit number of retries and employ exponential backoff to avoid resource exhaustion and backlog • Duplicates may happen; code should be idempotent
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EASIER IN A SERVERLESS WORLD • Lambda lets you set a timeout for your function • Use synchronous execution when response is needed • The invoking application receives a 429 error and is responsible for retries • Use asynchronous execution when no response is needed • Messages are queued until executed • Automatic retries with exponential backoff • Dead Letter Queue (DLQ) for failed events • Create and enable one DLQ per function—SQS or SNS • When unable to send error to configured DLQ, DLQ Errors metric will be updated
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. USE STEP FUNCTIONS FOR ADVANCED ORCHESTRATION
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Scalability
  • 18. HOW DO YOUR FUNCTIONS SCALE? Yes No Is there an active container available for this Lambda function that isn’t busy processing another event? Active Function Containers (Warm) New Function Container (Cold) AWS Lambda AWS Lambda Code Store After new function container is started: • Deployment package is downloaded • Lambda runtime environment is initialized Event
  • 19. Start your code COLD START: UNDERSTAND THE FUNCTI ON LI FECYCLE Cold start Download your code Start new container AWS optimization Your optimization Warm start
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. C OLD ST AR T : SI MPLI FY AND MI NI MI ZE DEPENDENC I ES • Minimize your deployment package size • Leverage modularity of the AWS SDK for Java and .NET • Reduce the complexity of your dependencies
  • 21. WARM START: LEVERAGE CONTAINER REUSE • Lazily load variables in the global scope—functions stay warm for several minutes •Don’t load it if you don’t need it every time s3 = boto3.resource('s3') db = db.connect() def lambda_handler(event, context): global db # verify if still connected # otherwise carry on if not db: db = db.connect() ...
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Continuous Delivery
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT IS A GOOD PROCESS? Easy to interpret Frequent and small changes Changes have scoped impact Automated deployments
  • 24. AWS SERVERLESS APPLICATION MODEL (SAM) AWS CloudFormation extension optimized for serverless New serverless resource types: functions, APIs, and tables Supports anything CloudFormation supports Open specification (Apache 2.0) https://github.com/awslabs/serverless-application-model
  • 25. SAM TEMPLATE AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml Runtime: nodejs4.3 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable Tells CloudFormation this is a SAM template it needs to “transform” Creates a Lambda function with the referenced managed IAM policy, runtime, code at the referenced zip location, and handler as defined. Also creates an API Gateway and takes care of all mapping/permissions necessary Creates a DynamoDB table with five Read and Write units
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT’S A GOOD PROCESS? Easy to interpret Frequent and small changes Changes have scoped impact Automated deployments ✔
  • 27. SAM LOCAL CLI tool for local 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 the Lambda execution environment: • Emulates timeout, memory limits, runtimes https://github.com/awslabs/aws-sam-local
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT’S A GOOD PROCESS? Easy to interpret Frequent and small changes Changes have scoped impact Automated deployments ✔ ✔
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TRAFFIC SHIFTING IN LAMBDA ALIASES Apply a “weight” to Lambda function aliases to shift traffic between two versions of your function! • 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
  • 30. AWS LAMBDA—TRAFFIC SHIFTING IN THE CLI # 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} }'
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT’S A GOOD PROCESS? Easy to interpret Frequent and small changes Changes have scoped impact Automated deployments ✔ ✔ ✔
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DELIVERY VIA CODEPIPELINE Pipeline flow: 1. Commit your code to a source code repository 2. Package/test in AWS CodeBuild 3. Use CloudFormation actions in AWS CodePipeline to create or update stacks via SAM templates Optional: make use of ChangeSets 4. Make use of specific stage/environment parameter files to pass in Lambda variables 5. Test our application between stages/environments Optional: make use of Manual Approvals
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT’S A GOOD PROCESS? Easy to interpret Frequent and small changes Changes have scoped impact Automated deployments ✔ ✔ ✔ ✔
  • 34. BRINGING IT ALL TOGETHER Resilience Scalability Continuous Delivery • Built-in resiliency and high availability • Orchestration available inside and outside of your code • Scales automatically • Pay only for work done • Easy to model and reason about deployments • Think pure business logic • Can now test locally • Automated process helps deliver frequently and safely
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. NIK KHILNANI SR. DIRECTOR, PLATFORM DEVELOPMENT NATIONAL GEOGRAPHIC PARTNERS nik.khilnani@natgeo.com
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Products • TV channels • Magazines and articles • Travel and eCommerce • Kids and live events • And more Reach • Content engagement: 6.4 billion/month • Households: 485 million • Social followers: 396 million • Countries: 172, languages: 43 • Proceeds returned to the non-profit National Geographic Society: 27% Technology • Strong emphasis on security • Independent regional systems • Heterogeneous system architectures • Re-platform in progress • Expanding internationally NATIONAL GEOGRAPHIC | FURTHER
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RE-PLATFORM | EXPANSION US Data Centers Multi-Region Global Decommission New Development
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE “NATGEO1” MOBILE APP Localized • Mobile native application launched in Australia • Exclusive to Optus, Australia’s second largest telecom • App specific premium content Content • Content spans full history of Nat Geo—1888 onwards • Short-form (clips) and long-form (VOD, Live) video • International magazine and article content • Social content from Instagram Personalized experience • Content adapts to user activity • Push notifications • iOS and Android, with video casting
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. APPLICATION ARCHITECTURE
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CONTENT AGGREGATION
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ASYNCHRONOUS PROCESSING
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CONTENT DELIVERY
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PERSONALIZATION Goal • Serve engaging and relevant content to our users • Display new content on repeat visits • Bring the user back to the application Lessons learned • Auto Scaling gave Amazon CloudSearch an edge over Amazon Elasticsearch • Amazon SNS push notifications are very reliable • Pay attention to push notification UX • Use Step Functions and Simple Workflow to limit Lambda state management in code
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IMAGE CLASSIFICATION Goal • Display images within sections of the application without human involvement Lessons learned • Plan for service limits early • Review synchronous versus asynchronous behavior of Amazon Rekognition • Review classification in relation to larger context of image use • Lambda managing Lambda is tricky Labels Confidence Arctic 98.9 Glacier 98.9 Ice 98.9 Mountain 98.9 Outdoors 98.9 Snow 98.9
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PERFORMANCE Goal • Performant microservices • Low operational overhead Lessons learned • Really understand service nuances • Understand cold starts/container lifecycle • Lambda execution consistent across spikes • Amazon API Gateway adds minimal overhead • Design with read/write capacity in mind • Amazon DynamoDB performance is very good Lambda Invocation Duration API Gateway Overhead DynamoDB Performance
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT’S NEXT Additional AWS services • Step Functions—launched after development started • Machine learning—take personalization further Technology improvements • International expansion • Continued emphasis on security • Alignment to 21st Century Fox strategy • Multi-tenancy and vendor abstractions Operations and monitoring • Additional custom metrics • Improve log analytics • Infrastructure and application automation Amazon Kinesis Amazon Machine Learning AWS Step Functions AWS Glue AWS CloudFormation AWS Certificate Manager AWS KMS
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. High availability • Continuous scaling • Concurrency • Resilience • Predictability Batteries included • Security • Managed services • Continuous delivery Increased productivity • Self-service • Empowered developers • Increased reuse • Focus on feature development Easier innovation • From on-premises to serverless • Image classification Reduced time-to-market • Aggressive fixed launch date • Coordinated launch between Nat Geo and Optus telecom Cost effective • Pay for what you use • Reduced financial risk SERVERLESS BENEFITS
  • 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!