SlideShare uma empresa Scribd logo
1 de 64
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Moving to Amazon ECS—the Not-So-
Obvious Benefits
F r a n z i s k a S c h m i d t , P l a t f o r m E n g i n e e r , M a p b o x
Y a n i v D o n e n f e l d , B u s i n e s s D e v e l o p m e n t M a n a g e r , A W S
D e c e m b e r 1 , 2 0 1 7
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Elastic Container Service
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Much more than container orchestration
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Concrete example, please…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Canary Deployments
• New version verification with (a subset of) real users
• Zero down-time
• Seamless rollback
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Canary Deployments with ECS
TaskTask
Amazon
Route 53
record set
with weighted
routing policy
0%
100%
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automated Canary Migration
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automated Canary Migration (Cont’d)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Show us more…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Significant Cost Savings
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot + On-Demand
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon
SQS
Watcher
Container
70,000 Tasks processed in one hour
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hi,
I’m Franziska Schmidt
Platform Engineer at Mapbox
@franschm
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Beautiful
Maps
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Geocoding and Search
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Developer tools
& Mobile sdks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Maps
Directions
Analysis
Teams and Systems @ Mapbox
Geocoding
Developer Tools
Mobile
Maps
Directions
Analysis
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Maps
Directions
Analysis
Teams and Systems @ Mapbox
Geocoding
Developer Tools
Mobile
Maps
Directions
Analysis
Platform
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Processing jobs
&
Api services
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Processing traffic at peak
70.000 tasks within one hour
200 Amazon EC2 instances at peak
Running in 2 AWS Regions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
API traffic at peak
500-1500 tasks
40-200 EC2 instances
Running in 7 AWS Regions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
About a year ago, we decided to migrate
our entire backend infrastructure to
Amazon ECS…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We decided to migrate to ECS for:
•Better Cost Savings
•Faster and more flexible Scaling
•Increased Developer productivity
The Obvious Benefits
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The
Not-So-Obvious
Benefits
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Non-Obvious Benefits
Open source, private infrastructure
Consistency across organisation
Cost Monitoring Tools
Empowering Teams
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What if…
I’m thinking about migrating over?
I’m in the middle of a system migration to ECS?
I’m already running on ECS successfully?
I run my systems on Kubernetes or ContainerSystemXYZ?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Open Source, Private Infrastructure
• Consistency across organisation
• Cost Clarity
• Empowering Teams
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A product developer asks you:
How can I run some code
on a server?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I run some code on a server?
The EC2 story (very simplified)
• Provision an EC2
• Boot the EC2
• Install requirements, set up your Node (/python/etc) environment
• Get your code onto the EC2
• Run your application!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I run some code on a server?
The ECS story (very simplified)
• Provision an EC2
• Boot the EC2
• Install requirements, set up your Node (/python/etc) environment
• Pull your code image onto the EC2
• Run your container!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Infrastructure code separation benefits:
• Developers don’t need to touch infrastructure setup
• Consolidating infrastructure scripts for better security
and control
• You can open source application code easier!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why Open Source?
• Idea exchange and
collaboration with
larger
communities and
domain
• More eyes on
makes better code
• Developer perks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Two ECS libraries we’ve open-sourced
•github.com/mapbox/ecs-conex
•Automated CI tool to push Docker images from GitHub commits to
Amazon ECR
•github.com/mapbox/ecs-watchbot
•CFN templates for running processing tasks on ECS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Migrating to ECS helped us
separate infrastructure setup from
core domain code.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Open Source, Private Infrastructure
Consistency across organisation
• Cost Clarity
• Empowering Teams
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ecs-api: AWS CloudFormation helper library
for setting up an ECS-based HTTP API
•Establish patterns, conventions and best practises across ECS use
•Reduce copy/paste shared functionalities
•Easier to pick up context in unknown projects
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFormation for consistency
•Version Control: Config changes leave
a paper trail
•Reproducibility
•Standardised usage
`/cloudformation` folder in each
repository
•Tool for building templates:
github.com/mapbox/cloudfriend
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Incident response
•Using CloudFormation for version control & reproducibility
•Standardised usage across repositories
•Shared libraries give you access to alarm utilities for standard
needs e.g. Memory / CPU utilisations, error status codes
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Big system migrations
provide opportunities for
rethinking system designs.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Open Source, Private Infrastructure
Consistency across organisation
Cost Clarity
• Empowering Teams
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot by Default
• Running on ECS is making it possible for us to run on
Spot by default
• Faster task start up, outages are easier to mitigate
• Diversify our task placement to limit impact of Spot
price outs
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cost Clarity:
Insight in cost spendings on a
per-service, per-team basis
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2: Total cost = Number of EC2s * (instance-type cost
per hour) * number of hours
For example,
If I ran 3 api-maps EC2s, at $16/hour, for 10 hours
= 3 * 16 * 10
= $480 ✅
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cost monitoring on ECS is more
complicated. => What’s the cost of my ECS
service?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What’s the cost of my ECS service?
1. Find all tasks of my service
=> Tasks are tagged with team, category attributes
2. Calculate task cost through cpu, memory, duration
3. Aggregate usage data in Amazon Athena
4. Surface cost info through GitHub issues, Slack bots
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We save costs through spot by
default on ECS; we gain clarity through
custom cost monitoring.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Open Source, Private Infrastructure
Consistency across organisation
Cost Clarity
Empowering Teams
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Empowering Teams
• Many benefits I’ve talked about can be
summarised as empowering teams
• Better tools to launch code faster
• More ownership over cost and spendings!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Ok, I’m sold.
How can I introduce a large system
shift in my organisation?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I introduce a large system shift in my organisation?
Make the
benefits obvious
to all
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I introduce a large system shift in my organisation?
Be empathetic
to other teams’ needs and perspectives
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I introduce a large system shift in my organisation?
Introduce plans timely
to get the work you
need on their roadmap
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I introduce a large system shift in my organisation?
Incorporate
fun and motivation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can I introduce a large system shift in my organisation?
Offer deliberate
time and support
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What's next for
Mapbox on Amazon ECS?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THANK YOU!

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
 
Living on the Edge, It’s Safer Than You Think! Building Strong with Amazon Cl...
Living on the Edge, It’s Safer Than You Think! Building Strong with Amazon Cl...Living on the Edge, It’s Safer Than You Think! Building Strong with Amazon Cl...
Living on the Edge, It’s Safer Than You Think! Building Strong with Amazon Cl...
 
Interstella 8888: Advanced Microservice Operations - CON407 - re:Invent 2017
Interstella 8888: Advanced Microservice Operations - CON407 - re:Invent 2017Interstella 8888: Advanced Microservice Operations - CON407 - re:Invent 2017
Interstella 8888: Advanced Microservice Operations - CON407 - re:Invent 2017
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
CON307_Building Effective Container Images
CON307_Building Effective Container ImagesCON307_Building Effective Container Images
CON307_Building Effective Container Images
 
CON317_Advanced container management at catsndogs.lol
CON317_Advanced container management at catsndogs.lolCON317_Advanced container management at catsndogs.lol
CON317_Advanced container management at catsndogs.lol
 
CTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video WorkflowsCTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video Workflows
 
CMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSCMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWS
 
Architecting Container Infrastructure for Security and Compliance - CON406 - ...
Architecting Container Infrastructure for Security and Compliance - CON406 - ...Architecting Container Infrastructure for Security and Compliance - CON406 - ...
Architecting Container Infrastructure for Security and Compliance - CON406 - ...
 
Introducing Amazon EKS
Introducing Amazon EKSIntroducing Amazon EKS
Introducing Amazon EKS
 
Birds of a Feather: Containers and Open Source at AWS - CON205 - re:Invent 2017
Birds of a Feather: Containers and Open Source at AWS - CON205 - re:Invent 2017Birds of a Feather: Containers and Open Source at AWS - CON205 - re:Invent 2017
Birds of a Feather: Containers and Open Source at AWS - CON205 - re:Invent 2017
 
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD PracticesDEV326_DevOps Essentials An Introductory Workshop on CICD Practices
DEV326_DevOps Essentials An Introductory Workshop on CICD Practices
 
Container Networking Deep Dive with Amazon ECS - CON401 - re:Invent 2017
Container Networking Deep Dive with Amazon ECS - CON401 - re:Invent 2017Container Networking Deep Dive with Amazon ECS - CON401 - re:Invent 2017
Container Networking Deep Dive with Amazon ECS - CON401 - re:Invent 2017
 
STG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWSSTG203_Get Rid of Tape and Modernize Backup with AWS
STG203_Get Rid of Tape and Modernize Backup with AWS
 
DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLI
 
CTD302_How Hulu reinvented Television using the AWS Cloud
CTD302_How Hulu reinvented Television using the AWS CloudCTD302_How Hulu reinvented Television using the AWS Cloud
CTD302_How Hulu reinvented Television using the AWS Cloud
 
GPSTEC325-Enterprise Storage
GPSTEC325-Enterprise StorageGPSTEC325-Enterprise Storage
GPSTEC325-Enterprise Storage
 
DEV317_Deep Dive on AWS CloudFormation
DEV317_Deep Dive on AWS CloudFormationDEV317_Deep Dive on AWS CloudFormation
DEV317_Deep Dive on AWS CloudFormation
 
Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017
Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017
Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017
 
How Do I Build a Global Transit Network on AWS? - MSC302 - re:Invent 2017
How Do I Build a Global Transit Network on AWS? - MSC302 - re:Invent 2017How Do I Build a Global Transit Network on AWS? - MSC302 - re:Invent 2017
How Do I Build a Global Transit Network on AWS? - MSC302 - re:Invent 2017
 

Semelhante a Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017

Semelhante a Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017 (20)

CON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersCON203_Driving Innovation with Containers
CON203_Driving Innovation with Containers
 
Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017Driving Innovation with Containers - CON203 - re:Invent 2017
Driving Innovation with Containers - CON203 - re:Invent 2017
 
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
 
Introducing Amazon Fargate
Introducing Amazon FargateIntroducing Amazon Fargate
Introducing Amazon Fargate
 
AWS 容器服務入門實務
AWS 容器服務入門實務AWS 容器服務入門實務
AWS 容器服務入門實務
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWS
 
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech TalksContainers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
 
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
 
Containers on AWS - re:Invent Comes to London 2.0
Containers on AWS - re:Invent Comes to London 2.0Containers on AWS - re:Invent Comes to London 2.0
Containers on AWS - re:Invent Comes to London 2.0
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day Israel
 
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...
 
Reactive Architectures with Microservices
Reactive Architectures with MicroservicesReactive Architectures with Microservices
Reactive Architectures with Microservices
 
Introduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
Introduction to AWS Fargate & Amazon Elastic Container Service for KubernetesIntroduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
Introduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
 
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-...
 
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
Case Study: Ola Cabs Uses Amazon EBS and Elastic Volumes to Maximize MySQL De...
 
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
 
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
 
Containers on AWS
Containers on AWSContainers on AWS
Containers on AWS
 

Mais de Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

Mais 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
 

Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Moving to Amazon ECS—the Not-So- Obvious Benefits F r a n z i s k a S c h m i d t , P l a t f o r m E n g i n e e r , M a p b o x Y a n i v D o n e n f e l d , B u s i n e s s D e v e l o p m e n t M a n a g e r , A W S D e c e m b e r 1 , 2 0 1 7
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Elastic Container Service
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Much more than container orchestration
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Concrete example, please…
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary Deployments • New version verification with (a subset of) real users • Zero down-time • Seamless rollback
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary Deployments with ECS TaskTask Amazon Route 53 record set with weighted routing policy 0% 100%
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Automated Canary Migration
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Automated Canary Migration (Cont’d)
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Show us more…
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Significant Cost Savings
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spot + On-Demand
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SQS Watcher Container 70,000 Tasks processed in one hour
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hi, I’m Franziska Schmidt Platform Engineer at Mapbox @franschm
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Beautiful Maps
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Geocoding and Search
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Developer tools & Mobile sdks
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Maps Directions Analysis Teams and Systems @ Mapbox Geocoding Developer Tools Mobile Maps Directions Analysis
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Maps Directions Analysis Teams and Systems @ Mapbox Geocoding Developer Tools Mobile Maps Directions Analysis Platform
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Processing jobs & Api services
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Processing traffic at peak 70.000 tasks within one hour 200 Amazon EC2 instances at peak Running in 2 AWS Regions
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. API traffic at peak 500-1500 tasks 40-200 EC2 instances Running in 7 AWS Regions
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. About a year ago, we decided to migrate our entire backend infrastructure to Amazon ECS…
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. We decided to migrate to ECS for: •Better Cost Savings •Faster and more flexible Scaling •Increased Developer productivity The Obvious Benefits
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Not-So-Obvious Benefits
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The Non-Obvious Benefits Open source, private infrastructure Consistency across organisation Cost Monitoring Tools Empowering Teams
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What if… I’m thinking about migrating over? I’m in the middle of a system migration to ECS? I’m already running on ECS successfully? I run my systems on Kubernetes or ContainerSystemXYZ?
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Open Source, Private Infrastructure • Consistency across organisation • Cost Clarity • Empowering Teams
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A product developer asks you: How can I run some code on a server?
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I run some code on a server? The EC2 story (very simplified) • Provision an EC2 • Boot the EC2 • Install requirements, set up your Node (/python/etc) environment • Get your code onto the EC2 • Run your application!
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I run some code on a server? The ECS story (very simplified) • Provision an EC2 • Boot the EC2 • Install requirements, set up your Node (/python/etc) environment • Pull your code image onto the EC2 • Run your container!
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Infrastructure code separation benefits: • Developers don’t need to touch infrastructure setup • Consolidating infrastructure scripts for better security and control • You can open source application code easier!
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why Open Source? • Idea exchange and collaboration with larger communities and domain • More eyes on makes better code • Developer perks
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Two ECS libraries we’ve open-sourced •github.com/mapbox/ecs-conex •Automated CI tool to push Docker images from GitHub commits to Amazon ECR •github.com/mapbox/ecs-watchbot •CFN templates for running processing tasks on ECS
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Migrating to ECS helped us separate infrastructure setup from core domain code.
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Open Source, Private Infrastructure Consistency across organisation • Cost Clarity • Empowering Teams
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ecs-api: AWS CloudFormation helper library for setting up an ECS-based HTTP API •Establish patterns, conventions and best practises across ECS use •Reduce copy/paste shared functionalities •Easier to pick up context in unknown projects
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudFormation for consistency •Version Control: Config changes leave a paper trail •Reproducibility •Standardised usage `/cloudformation` folder in each repository •Tool for building templates: github.com/mapbox/cloudfriend
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Incident response •Using CloudFormation for version control & reproducibility •Standardised usage across repositories •Shared libraries give you access to alarm utilities for standard needs e.g. Memory / CPU utilisations, error status codes
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Big system migrations provide opportunities for rethinking system designs.
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Open Source, Private Infrastructure Consistency across organisation Cost Clarity • Empowering Teams
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spot by Default • Running on ECS is making it possible for us to run on Spot by default • Faster task start up, outages are easier to mitigate • Diversify our task placement to limit impact of Spot price outs
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cost Clarity: Insight in cost spendings on a per-service, per-team basis
  • 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2: Total cost = Number of EC2s * (instance-type cost per hour) * number of hours For example, If I ran 3 api-maps EC2s, at $16/hour, for 10 hours = 3 * 16 * 10 = $480 ✅
  • 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cost monitoring on ECS is more complicated. => What’s the cost of my ECS service?
  • 50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What’s the cost of my ECS service? 1. Find all tasks of my service => Tasks are tagged with team, category attributes 2. Calculate task cost through cpu, memory, duration 3. Aggregate usage data in Amazon Athena 4. Surface cost info through GitHub issues, Slack bots
  • 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. We save costs through spot by default on ECS; we gain clarity through custom cost monitoring.
  • 53. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Open Source, Private Infrastructure Consistency across organisation Cost Clarity Empowering Teams
  • 54. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Empowering Teams • Many benefits I’ve talked about can be summarised as empowering teams • Better tools to launch code faster • More ownership over cost and spendings!
  • 55. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ok, I’m sold. How can I introduce a large system shift in my organisation?
  • 56. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I introduce a large system shift in my organisation? Make the benefits obvious to all
  • 57. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I introduce a large system shift in my organisation? Be empathetic to other teams’ needs and perspectives
  • 58. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I introduce a large system shift in my organisation? Introduce plans timely to get the work you need on their roadmap
  • 59. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I introduce a large system shift in my organisation? Incorporate fun and motivation
  • 60. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 61. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How can I introduce a large system shift in my organisation? Offer deliberate time and support
  • 62. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 63. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What's next for Mapbox on Amazon ECS?
  • 64. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THANK YOU!