SlideShare ist ein Scribd-Unternehmen logo
1 von 47
S U M M I T
B AH RAI N
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Breaking up the Monolith
with Containers
Paul Maddox
Principal Architect
AWS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
About me
Paul Maddox
Principal Architect, AWS Containers
• 17 years of dev, SRE, and systems architecture background
• 4.5 years at AWS
• Developer: Go, Rust, Java, JS
• Written some parts of AWS, some non-AWS
• I talk about containers a lot
Twitter: @paulmaddox@paulmaddox
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Agenda
When and why to use microservices
How to move to microservices
Overcoming common pitfalls
Wrap up, next steps, and resources
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon.com used to
be a monolith
• Large executable
• Long time to compile
• Long time to deploy
• Blurred ownership
https://www.flickr.com/photos/treehouse1977/3687758531
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
2001
Decentralization of technologies and teams transformation
at Amazon: 2001-2009
2009
Monolithic
application + teams
Microservices + two pizza teams
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon.com
Retail platform architecture
circa 2009
…10 years ago.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Pros
• Teams can develop services
independently
• Team can deploy services independently
• Teams can scale services independently
• Teams can choose the best technologies
for their service
• Teams can onboard developers faster
(simple codebase)
Why microservices?
Cons
• Complexity is not removed, it is moved
from the codebase
• New techniques/tooling for observability
and communication required
• More language/technology agnostic
tooling required
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Key indicators for microservices
• You have more than one development team
• You suffer from too much change control process
• You want to scale your organization
Key indicators against microservices
• You are a small startup and getting an MVP shipped is your priority
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Move functionality to microservices in chunks
Prioritize services that change frequently
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Reducing change control overhead through APIs
If you are not making a breaking changing your API contract,
… and you're not changing your service availability contract,
… then every change becomes an implementation detail
internal to your team
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Choose your flavor of compute
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Benefits of containers for microservices
• Agility
• Tooling
• Community
• Containerization of existing applications
• Isolation
• Cost efficiency
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS container services landscape
Management
Deployment, scheduling,
scaling, and management of
containerized applications
Hosting
Where the containers run
Amazon Elastic
Container Service
(Amazon ECS)
Amazon Elastic
Kubernetes Service
(Amazon EKS)
Amazon EC2 AWS Fargate
Image Registry
Container image repository
Amazon Elastic
Container Registry
(Amazon ECR)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Managed by AWS
No Amazon EC2 Instances to provision, scale or
manage
Elastic
Scale up and down seamlessly
Pay only for what you use
Integrated
with AWS: Amazon VPC networking, Elastic Load
Balancing, IAM permissions, CloudWatch, and more
AWS Fargate
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS Fargate: Security built in
Network Isolation
Use AWS Security Groups to secure and isolate your
container traffic
Kernel Level Isolation
AWS ensures that your containers are isolated from others
at the hypervisor level – they do not share an OS kernel
Access & Auditing
Use IAM to control access to your container resources, as
well as roles to assign permissions to containerized apps
AWS CloudTrail provides detailed auditing information
Compliance
Suitable for regulated workloads
Certified ISO, PCI, SOC 1, SOC 2, and SOC 3
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS Fargate customers
”We don't want to babysit
any clusters. That has
nothing to do with us.”
Shimon Tolts
CTO, DATREE
“We moved to Fargate because we
need the ability to scale quickly up
from baseline and get fine-grained
network control without having to
manage our own infrastructure.”
Product Hunt
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
migrated ~850 applications running in ~5,000 containers
to Fargate to reduce the undifferentiated heavy lifting
that came with managing Kubernetes
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Infrastructure Automation
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Consistency = trust = less manual process overhead
Trust is the key to reducing manual approvals and analysis paralysis.
Your organization needs to trust that you can catch bugs before
production and, in the case of a problem, recover quickly and safely.
Achieve this with:
• Consistency between test and production environments
• The correct amount of unit, integration, and end-to-end testing
• Safe zero-downtime deployment techniques (e.g. canary)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Infrastructure automation with AWS CDK
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Test and release automation
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cd-pipeline.html
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Common microservices questions
How do I control traffic routing?
• Service discovery
• Weighted routing
How can I make my services more reliable?
• Retry/back-off policies
• Connection pooling
• Circuit breakers
How do I observe my services?
• Rich protocol-aware metrics (e.g. P99 latency, HTTP response codes)
• Centralized logging
How do I secure my services?
• Only this service can talk to that service
• Encryption of traffic in transit
• Authentication of service-to-service communication
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Common microservices questions
How do I control traffic routing?
• Service discovery
• Weighted routing
How can I make my services more reliable?
• Retry/back-off policies
• Connection pooling
• Circuit breakers
How do I observe my services?
• Rich protocol-aware metrics (e.g. P99 latency, HTTP response codes)
• Centralized logging
How do I secure my services?
• Only this service can talk to that service
• Encryption of traffic in transit
• Authentication of service-to-service communication
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
History
3-tierarchitectures
NetflixHystrix
Nagios
Cacti
ServiceOrientedArchitectures(SOA)
NewRelic,AppDynamicsboth
foundedDatadogfounded
1995 2001 2002 2002 2008
AmazonCloudWatchlaunched
2009 2010 2011
Infrastructure
Monitoring
APM
Language Specific
Observability &
Failure Handling
JRugged
2013 2013
AirBNBSmartStack
LinkerD
2016
Istio
2016
AWSAppMesh
2019
Language and technology
agnostic service meshes for:
- Observability
- Routing
- Failure Handling
- Security
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Rust
Database
DB
Database
Rust
GoNode.is
Java
Node.is
Node.is
Infrastructure team
Service
teams
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Containers
Database
DB
Database
Containers
λContainers
VMs
AWS
Lambda
Managed
Service
Infrastructure team
Service
teams
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Option 1: Library/SDK
Java
Scala
Node.js
Python
C++
Django
.NET
GO
…
Languages
Application code changes
Consistency across services
SDK maintenance
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Option 2: Side-car proxy
Proxy runs
as a container
Task or Pod
External traffic
Application
Container
Proxy
Monitoring
Routing
Discovery
Deployment
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
OSS project
Wide community support, numerous integrations
Stable and production-proven
“Graduated Project” in Cloud Native Computing Foundation
Started at Lyft in 2016
App Mesh uses Envoy proxy
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
App Mesh control plane
Control
Plane
Proxy Configuration
Communication flows from proxy to control plane
Uses Envoy xDS protocol over GRPC
https://github.com/envoyproxy/data-plane-api/blob/master/xds_protocol.rst
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
App Mesh data plane
Control
Plane
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
App Mesh uses a managed control plane
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Advanced routing controls
• Weighted routing
• HTTP path based routing
• HTTP header based routing
• Automatic retry policies (per HTTP response code)
Examples
Route products to my products microservice
Send 99% of traffic to my old version, and 1% to my new version
If a 'beta-user' HTTP cookie is set, route to my beta version
If a downstream service has a 5XX error, transparently retry every 15s, a maximum of 3 times
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Envoy protocol level observability (layer 7)
StatsD
sends metrics to a StatsD
server
Logging
generates access logs
Integrations with
Datadog, Alcide, HashiCorp, Sysdig, Signalfx, Spotinst, Tetrate,
Neuvector, Weaveworks, Twistlock, Wavefront by VMware, Aqua
AWS X-Ray
forwards traces to AWS
Prometheus
Exporter
listens on tcp/9090
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Example App Mesh dashboard (mesh-wide)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Example App Mesh dashboard (per-service)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
A language and technology agnostic approach to microservices
AWS App Mesh is language agnostic
• No application modifications required
• App Mesh doesn't care what language your application is written in
AWS App Mesh is technology agnostic
• Create a single mesh across applications deployed to Amazon EC2, Amazon ECS, Amazon EKS, self-managed
Kubernetes, and in the future, AWS Lambda
There is no additional charge for using AWS App Mesh
• You pay only for the AWS resources (Amazon EC2 instances or requested Fargate CPU and memory) consumed
by the lightweight proxy that is deployed alongside your containers
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Summary
• Microservices is not the answer to all problems; it's a mechanism for scaling an organization
• Move to microservices by chipping away at the monolith piece by piece, prioritizing the areas
that change the most, and creating microservices for any new features/functionality
• Moving to microservices requires technology and language agnostic tooling
• AWS Container Services (Amazon ECS/Amazon EKS/Fargate) make running microservices
easier
• AWS App Mesh solves a lot of the common challenges for operating microservices at scale
Thank you!
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
@paulmaddox
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

AWS identity services - Enabling & securing your cloud journey - SEC202 - San...
AWS identity services - Enabling & securing your cloud journey - SEC202 - San...AWS identity services - Enabling & securing your cloud journey - SEC202 - San...
AWS identity services - Enabling & securing your cloud journey - SEC202 - San...
 
Moving desktops & applications to AWS with Amazon WorkSpaces & AppStream 2 - ...
Moving desktops & applications to AWS with Amazon WorkSpaces & AppStream 2 - ...Moving desktops & applications to AWS with Amazon WorkSpaces & AppStream 2 - ...
Moving desktops & applications to AWS with Amazon WorkSpaces & AppStream 2 - ...
 
Introduction to the AWS Cloud - AWSome Day 2019 - Chicago
Introduction to the AWS Cloud - AWSome Day 2019 - ChicagoIntroduction to the AWS Cloud - AWSome Day 2019 - Chicago
Introduction to the AWS Cloud - AWSome Day 2019 - Chicago
 
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS SummitTwelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
 
Design with ops in mind | AWS Summit Tel Aviv 2019
Design with ops in mind | AWS Summit Tel Aviv 2019Design with ops in mind | AWS Summit Tel Aviv 2019
Design with ops in mind | AWS Summit Tel Aviv 2019
 
從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全從業人員指南-如何像技術專家一樣守護您的雲端安全
從業人員指南-如何像技術專家一樣守護您的雲端安全
 
AWS Fargate deep dive - MAD303 - Chicago AWS Summit
AWS Fargate deep dive - MAD303 - Chicago AWS SummitAWS Fargate deep dive - MAD303 - Chicago AWS Summit
AWS Fargate deep dive - MAD303 - Chicago AWS Summit
 
Introduction to the AWS Cloud - AWSome Day 2019 - Charlotte
Introduction to the AWS Cloud - AWSome Day 2019 - CharlotteIntroduction to the AWS Cloud - AWSome Day 2019 - Charlotte
Introduction to the AWS Cloud - AWSome Day 2019 - Charlotte
 
Exploring the fundamentals of AWS networking - SVC211 - New York AWS Summit
Exploring the fundamentals of AWS networking - SVC211 - New York AWS SummitExploring the fundamentals of AWS networking - SVC211 - New York AWS Summit
Exploring the fundamentals of AWS networking - SVC211 - New York AWS Summit
 
Building APIs from front to back - MAD314 - Chicago AWS Summit
Building APIs from front to back - MAD314 - Chicago AWS SummitBuilding APIs from front to back - MAD314 - Chicago AWS Summit
Building APIs from front to back - MAD314 - Chicago AWS Summit
 
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
 
AWS identity services: Enabling and securing your cloud journey - SEC203 - Ch...
AWS identity services: Enabling and securing your cloud journey - SEC203 - Ch...AWS identity services: Enabling and securing your cloud journey - SEC203 - Ch...
AWS identity services: Enabling and securing your cloud journey - SEC203 - Ch...
 
Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...Build data-driven, high-performance, internet-scale applications with AWS dat...
Build data-driven, high-performance, internet-scale applications with AWS dat...
 
VMware Cloud on AWS - Canberra Lunch & Learn
VMware Cloud on AWS - Canberra Lunch & LearnVMware Cloud on AWS - Canberra Lunch & Learn
VMware Cloud on AWS - Canberra Lunch & Learn
 
Carry security with you to the cloud - DEM14-SR - New York AWS Summit
Carry security with you to the cloud - DEM14-SR - New York AWS SummitCarry security with you to the cloud - DEM14-SR - New York AWS Summit
Carry security with you to the cloud - DEM14-SR - New York AWS Summit
 
AWS Dev Lounge: Taking Control of Your Microservices with AWS App Mesh
AWS Dev Lounge: Taking Control of Your Microservices with AWS App MeshAWS Dev Lounge: Taking Control of Your Microservices with AWS App Mesh
AWS Dev Lounge: Taking Control of Your Microservices with AWS App Mesh
 
Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...Building ML platforms in Financial Services with serverless technology - FSV2...
Building ML platforms in Financial Services with serverless technology - FSV2...
 
How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...
 
如何成功的完成混合雲遷移專案
如何成功的完成混合雲遷移專案如何成功的完成混合雲遷移專案
如何成功的完成混合雲遷移專案
 
Scale fearlessly with Amazon DynamoDB adaptive capacity - ADB302 - Santa Clar...
Scale fearlessly with Amazon DynamoDB adaptive capacity - ADB302 - Santa Clar...Scale fearlessly with Amazon DynamoDB adaptive capacity - ADB302 - Santa Clar...
Scale fearlessly with Amazon DynamoDB adaptive capacity - ADB302 - Santa Clar...
 

Ähnlich wie Breaking Up the Monolith with Containers

DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
Amazon Web Services
 

Ähnlich wie Breaking Up the Monolith with Containers (20)

A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
 
Introduction to AWS App Mesh - MAD303 - Atlanta AWS Summit
Introduction to AWS App Mesh - MAD303 - Atlanta AWS SummitIntroduction to AWS App Mesh - MAD303 - Atlanta AWS Summit
Introduction to AWS App Mesh - MAD303 - Atlanta AWS Summit
 
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
 
利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統
 
AWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern Applications
 
From Monolith to Microservices
From Monolith to MicroservicesFrom Monolith to Microservices
From Monolith to Microservices
 
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS SummitManaging microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
Managing microservices using AWS App Mesh - MAD302 - Chicago AWS Summit
 
利用微服務加速創新的步伐
利用微服務加速創新的步伐利用微服務加速創新的步伐
利用微服務加速創新的步伐
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
 
Well Archictecture Framework dotNET.pdf
Well Archictecture Framework dotNET.pdfWell Archictecture Framework dotNET.pdf
Well Archictecture Framework dotNET.pdf
 
Building well architected .NET applications - SVC209 - Atlanta AWS Summit
Building well architected .NET applications - SVC209 - Atlanta AWS SummitBuilding well architected .NET applications - SVC209 - Atlanta AWS Summit
Building well architected .NET applications - SVC209 - Atlanta AWS Summit
 
Control your cloud environment with AWS management tools
Control your cloud environment with AWS management toolsControl your cloud environment with AWS management tools
Control your cloud environment with AWS management tools
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
 
Migrating Business Critical Applications to AWS
Migrating Business Critical Applications to AWSMigrating Business Critical Applications to AWS
Migrating Business Critical Applications to AWS
 
A culture of rapid innovation with DevOps, microservices, & serverless - MAD2...
A culture of rapid innovation with DevOps, microservices, & serverless - MAD2...A culture of rapid innovation with DevOps, microservices, & serverless - MAD2...
A culture of rapid innovation with DevOps, microservices, & serverless - MAD2...
 
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
Built & Delivered in Six Months Using Serverless Technical Patterns and Micro...
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWS
 
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
 
AWS Secret Region – Lessons Learned Around DevSecOps
AWS Secret Region – Lessons Learned Around DevSecOpsAWS Secret Region – Lessons Learned Around DevSecOps
AWS Secret Region – Lessons Learned Around DevSecOps
 

Mehr von 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
 

Mehr von 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
 

Breaking Up the Monolith with Containers

  • 1. S U M M I T B AH RAI N
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Breaking up the Monolith with Containers Paul Maddox Principal Architect AWS
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T About me Paul Maddox Principal Architect, AWS Containers • 17 years of dev, SRE, and systems architecture background • 4.5 years at AWS • Developer: Go, Rust, Java, JS • Written some parts of AWS, some non-AWS • I talk about containers a lot Twitter: @paulmaddox@paulmaddox
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Agenda When and why to use microservices How to move to microservices Overcoming common pitfalls Wrap up, next steps, and resources
  • 5. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon.com used to be a monolith • Large executable • Long time to compile • Long time to deploy • Blurred ownership https://www.flickr.com/photos/treehouse1977/3687758531
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 2001 Decentralization of technologies and teams transformation at Amazon: 2001-2009 2009 Monolithic application + teams Microservices + two pizza teams
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon.com Retail platform architecture circa 2009 …10 years ago.
  • 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Pros • Teams can develop services independently • Team can deploy services independently • Teams can scale services independently • Teams can choose the best technologies for their service • Teams can onboard developers faster (simple codebase) Why microservices? Cons • Complexity is not removed, it is moved from the codebase • New techniques/tooling for observability and communication required • More language/technology agnostic tooling required
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Key indicators for microservices • You have more than one development team • You suffer from too much change control process • You want to scale your organization Key indicators against microservices • You are a small startup and getting an MVP shipped is your priority
  • 11. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Move functionality to microservices in chunks Prioritize services that change frequently
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Reducing change control overhead through APIs If you are not making a breaking changing your API contract, … and you're not changing your service availability contract, … then every change becomes an implementation detail internal to your team
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Choose your flavor of compute
  • 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Benefits of containers for microservices • Agility • Tooling • Community • Containerization of existing applications • Isolation • Cost efficiency
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS container services landscape Management Deployment, scheduling, scaling, and management of containerized applications Hosting Where the containers run Amazon Elastic Container Service (Amazon ECS) Amazon Elastic Kubernetes Service (Amazon EKS) Amazon EC2 AWS Fargate Image Registry Container image repository Amazon Elastic Container Registry (Amazon ECR)
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Managed by AWS No Amazon EC2 Instances to provision, scale or manage Elastic Scale up and down seamlessly Pay only for what you use Integrated with AWS: Amazon VPC networking, Elastic Load Balancing, IAM permissions, CloudWatch, and more AWS Fargate
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS Fargate: Security built in Network Isolation Use AWS Security Groups to secure and isolate your container traffic Kernel Level Isolation AWS ensures that your containers are isolated from others at the hypervisor level – they do not share an OS kernel Access & Auditing Use IAM to control access to your container resources, as well as roles to assign permissions to containerized apps AWS CloudTrail provides detailed auditing information Compliance Suitable for regulated workloads Certified ISO, PCI, SOC 1, SOC 2, and SOC 3
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS Fargate customers ”We don't want to babysit any clusters. That has nothing to do with us.” Shimon Tolts CTO, DATREE “We moved to Fargate because we need the ability to scale quickly up from baseline and get fine-grained network control without having to manage our own infrastructure.” Product Hunt
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T migrated ~850 applications running in ~5,000 containers to Fargate to reduce the undifferentiated heavy lifting that came with managing Kubernetes
  • 21. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Infrastructure Automation
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Consistency = trust = less manual process overhead Trust is the key to reducing manual approvals and analysis paralysis. Your organization needs to trust that you can catch bugs before production and, in the case of a problem, recover quickly and safely. Achieve this with: • Consistency between test and production environments • The correct amount of unit, integration, and end-to-end testing • Safe zero-downtime deployment techniques (e.g. canary)
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Infrastructure automation with AWS CDK
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Test and release automation https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cd-pipeline.html
  • 28. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Common microservices questions How do I control traffic routing? • Service discovery • Weighted routing How can I make my services more reliable? • Retry/back-off policies • Connection pooling • Circuit breakers How do I observe my services? • Rich protocol-aware metrics (e.g. P99 latency, HTTP response codes) • Centralized logging How do I secure my services? • Only this service can talk to that service • Encryption of traffic in transit • Authentication of service-to-service communication
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Common microservices questions How do I control traffic routing? • Service discovery • Weighted routing How can I make my services more reliable? • Retry/back-off policies • Connection pooling • Circuit breakers How do I observe my services? • Rich protocol-aware metrics (e.g. P99 latency, HTTP response codes) • Centralized logging How do I secure my services? • Only this service can talk to that service • Encryption of traffic in transit • Authentication of service-to-service communication
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T History 3-tierarchitectures NetflixHystrix Nagios Cacti ServiceOrientedArchitectures(SOA) NewRelic,AppDynamicsboth foundedDatadogfounded 1995 2001 2002 2002 2008 AmazonCloudWatchlaunched 2009 2010 2011 Infrastructure Monitoring APM Language Specific Observability & Failure Handling JRugged 2013 2013 AirBNBSmartStack LinkerD 2016 Istio 2016 AWSAppMesh 2019 Language and technology agnostic service meshes for: - Observability - Routing - Failure Handling - Security
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Rust Database DB Database Rust GoNode.is Java Node.is Node.is Infrastructure team Service teams
  • 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Containers Database DB Database Containers λContainers VMs AWS Lambda Managed Service Infrastructure team Service teams
  • 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Option 1: Library/SDK Java Scala Node.js Python C++ Django .NET GO … Languages Application code changes Consistency across services SDK maintenance
  • 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Option 2: Side-car proxy Proxy runs as a container Task or Pod External traffic Application Container Proxy Monitoring Routing Discovery Deployment
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T OSS project Wide community support, numerous integrations Stable and production-proven “Graduated Project” in Cloud Native Computing Foundation Started at Lyft in 2016 App Mesh uses Envoy proxy
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T App Mesh control plane Control Plane Proxy Configuration Communication flows from proxy to control plane Uses Envoy xDS protocol over GRPC https://github.com/envoyproxy/data-plane-api/blob/master/xds_protocol.rst
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T App Mesh data plane Control Plane
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T App Mesh uses a managed control plane
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Advanced routing controls • Weighted routing • HTTP path based routing • HTTP header based routing • Automatic retry policies (per HTTP response code) Examples Route products to my products microservice Send 99% of traffic to my old version, and 1% to my new version If a 'beta-user' HTTP cookie is set, route to my beta version If a downstream service has a 5XX error, transparently retry every 15s, a maximum of 3 times
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Envoy protocol level observability (layer 7) StatsD sends metrics to a StatsD server Logging generates access logs Integrations with Datadog, Alcide, HashiCorp, Sysdig, Signalfx, Spotinst, Tetrate, Neuvector, Weaveworks, Twistlock, Wavefront by VMware, Aqua AWS X-Ray forwards traces to AWS Prometheus Exporter listens on tcp/9090
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Example App Mesh dashboard (mesh-wide)
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Example App Mesh dashboard (per-service)
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T A language and technology agnostic approach to microservices AWS App Mesh is language agnostic • No application modifications required • App Mesh doesn't care what language your application is written in AWS App Mesh is technology agnostic • Create a single mesh across applications deployed to Amazon EC2, Amazon ECS, Amazon EKS, self-managed Kubernetes, and in the future, AWS Lambda There is no additional charge for using AWS App Mesh • You pay only for the AWS resources (Amazon EC2 instances or requested Fargate CPU and memory) consumed by the lightweight proxy that is deployed alongside your containers
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Summary • Microservices is not the answer to all problems; it's a mechanism for scaling an organization • Move to microservices by chipping away at the monolith piece by piece, prioritizing the areas that change the most, and creating microservices for any new features/functionality • Moving to microservices requires technology and language agnostic tooling • AWS Container Services (Amazon ECS/Amazon EKS/Fargate) make running microservices easier • AWS App Mesh solves a lot of the common challenges for operating microservices at scale
  • 46. Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. @paulmaddox
  • 47. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.