SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Interstella 8888: Monolith to
Microservices with Amazon ECS
H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t
A n d y M u i , A W S S o l u t i o n s A r c h i t e c t
D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t
C O N 3 1 8
N o v e m b e r 2 8 , 2 0 1 7
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Monolith to Microservices with Amazon ECS
H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t
A n d y M u i , A W S S o l u t i o n s A r c h i t e c t
D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t
C O N 3 1 8
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ABOUT ME
kuodavid@amazon.com
Solutions Architect
2.7 years at AWS
Based in Southern California
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT TO EXPECT
Monolith versus Microservices Architectures
Strangler Application Pattern
Amazon EC2 Container Service (ECS)
Hands-On Lab
• Break Apart the Monolith
• Independently
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WHAT ARE MICROSERVICES?
“A software architecture style in which complex applications are composed
of small, independent processes communicating with each other using
language-agnostic APIs. These services are small, highly decoupled and
focus on doing a small task, facilitating a modular approach to system-
building.” –Wikipedia
Great article on the topic:
https://martinfowler.com/articles/microservices.html
Source: https://en.wikipedia.org/wiki/Microservices
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MONOLITHIC VERSUS MICROSERVICES
Admin UI
Orders Service
Inventory Service
Shipping Service
Admin UI
Orders
Service
Inventory
Service
Shipping
Service
Customer UI
Customer
UI
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MONOLITHIC CHALLENGES
Admin UI
Orders Service
Inventory Service
Shipping Service
Customer UI
Code Maintenance—large, complex code base, long
dev cycles
Deployments—lengthy, complicated process, often
becomes the bottleneck
Ownership—many developers, same codebase
Scale—difficult to scale efficiently
Tools—limited technology choices (for example,
database, programming language)
Dependencies—tight coupling, difficult to manage
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MICROSERVICES BENEFITS
Admin UI
Orders
Service
Inventory
Service
Shipping
Service
Customer
UICode Maintenance—smaller units of code
Deployments—each service has its own
roadmap and pipeline
Ownership—smaller teams own services
Scale—each service can scale independently
Tools—polyglot environment
Dependencies—loose coupling, standardized
communications
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MONOLITH TO MICROSERVICES
Rewrite the app
Look at all that technical debt and piled up
cruft
Is Bob the Wizard who wrote that glue code
even still around?
Potential downtime and risk for full cutover
Let’s consider the Strangler Application
Pattern for a more incremental approach…
Source: https://xkcd.com/292/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
STRANGLER APPLICATION PATTERN
Gradually build something new
alongside the monolith
New functionality replaces methods
in the monolith
Over time, the new system
“strangles” the old system, until the
old dies out
Ideal for web applications, API-
structured applications, queue-based
systems
Source: https://en.wikipedia.org/wiki/Strangler_fig
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MICROSERVICES & CONTAINERS
Portable units of work
Simple to model
Any app, any language
Image is the version
Test and deploy same artifact
Stateless servers reduce change risk
Admin UI
Orders
Service
Inventory
Service
Shipping
Service
Customer
UI
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS
EC2 INSTANCES
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container AGENT COMMUNICATION
SERVICE
Amazon
ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
Internet LOAD
BALANCER
LOAD
BALANCER
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AMAZON ECS—TASK DEFINITION
{
"containerDefinitions": [
{
"name": "wordpress",
"links": [ "mysql" ],
"image": "wordpress",
"essential": true,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
} ],
"memory": 500,
"cpu": 10
},
{
"name": "mysql",
"image": "mysql",
"cpu": 10,
"memory": 500,
Instructions used by ECS to launch
containers
JSON template
Used to launch tasks and services
Maps to docker run parameters
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HANDS-ON LAB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WELCOME TO INTERSTELLA 8888
Interstella 8888 is an intergalactic trading company that was
established to import and export rare resources in the universe.
Interstella was a thriving company, but business has been
declining despite a booming economy. You and a few other
consultants have been brought on board to turn this around. Will
you be able to restore Interstella to its former glory?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
YOUR MISSION
Interstella 8888 operates a logistics platform to control the processing centers of
the four rare resources—tiberium, vespene gas, spice melange, and dilithium
crystals. We believe microservices will help us scale more efficiently and adopt a
more agile development pipeline. We need your help to incrementally break down
the monolith codebase and roll out the new microservices that our developers have
been working on. Each microservice will be responsible for processing orders for a
specific resource.
Lab 1: Build and deploy monolith container using ECS
Lab 2: Incrementally build and deploy each microservice
Bonus Lab: Scale microservices with an Application Load Balancer (ALB)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WORKSHOP ENVIRONMENT
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
Orders come into
the logistics
platform as HTTP
POST messages via
Amazon Simple
Notification Service
(Amazon SNS)
Amazon S3 hosts
web content and
utilities—API key
generator, order
subscription, order
dashboard
The logistics platform
communicates with an
order fulfillment API
running on Amazon
API Gateway; order
data is stored in
Amazon DynamoDB
Amazon
CloudWatch
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 1 (ECS REFRESHER)
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
1. Build a Docker image
for the monolith
from the provided
Dockerfile; Push
image to ECR
2. Create an ECS task
definition to deploy
the monolith image
and log to
CloudWatch Logs
3. Deploy the monolith
using ECS
M
FULFILL
Amazon
CloudWatch
Amazon
ECR
Amazon
ECS
LOGS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 2
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Build a Docker image for
a resource microservice
and store in ECR
2. Create an an ECS task
definition to deploy the
microservice image
3. Deploy the microservice
image using ECS to start
processing orders for that
resource
4. Modify the monolith code
to remove functionality
of the microservice;
rebuild
the monolith image and
re-deploy
M
FULFILL
Amazon
CloudWatch
m
FULFILL
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BONUS LAB
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Create an Application
Load Balancer (ALB)
2. Create an ECS service
that ties in the ALB
for routing orders to
monolith and resource
microservices; ALB
will use path-based
routing to route to
each microservice
target group
3. Repeat until all
microservices are
deployed
M
FULFILL
Amazon
CloudWatch Application
Load Balancer
m
FULFILL
/vespene
/melange
m
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LOGISTICS
INSTRUCTIONS:
http://interstella.trade/workshop2/
ORDERS TOPIC:
arn:aws:sns:us-west-2:270206935686:monolith
Raise your hand if you have any questions. High five your neighbors and
have fun!
Please fill out feedback forms once you are done! Feel free to email us
with comments/questions/feedback: aws-interstella-team@amazon.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

Mais conteúdo relacionado

Mais procurados

Building Manageable Windows Workloads - ARC324 - re:Invent 2017
Building Manageable Windows Workloads - ARC324 - re:Invent 2017Building Manageable Windows Workloads - ARC324 - re:Invent 2017
Building Manageable Windows Workloads - ARC324 - re:Invent 2017Amazon Web Services
 
Storage State of the Union - STG201 - re:Invent 2017
Storage State of the Union - STG201 - re:Invent 2017Storage State of the Union - STG201 - re:Invent 2017
Storage State of the Union - STG201 - re:Invent 2017Amazon Web Services
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSAmazon Web Services
 
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...Amazon 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
 
Improving Microservice and Serverless Observability with Monitoring Data - SR...
Improving Microservice and Serverless Observability with Monitoring Data - SR...Improving Microservice and Serverless Observability with Monitoring Data - SR...
Improving Microservice and Serverless Observability with Monitoring Data - SR...Amazon Web Services
 
Building Best Practices and the Right Foundation for your 1st Production Work...
Building Best Practices and the Right Foundation for your 1st Production Work...Building Best Practices and the Right Foundation for your 1st Production Work...
Building Best Practices and the Right Foundation for your 1st Production Work...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
 
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.lolAmazon Web Services
 
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...Amazon Web Services
 
CTD403_Supercharge Your Websites with the Power of Lambda@Edge
CTD403_Supercharge Your Websites with the Power of Lambda@EdgeCTD403_Supercharge Your Websites with the Power of Lambda@Edge
CTD403_Supercharge Your Websites with the Power of Lambda@EdgeAmazon Web Services
 
IOT312_A New Generation IoT Core Platform
IOT312_A New Generation IoT Core PlatformIOT312_A New Generation IoT Core Platform
IOT312_A New Generation IoT Core PlatformAmazon 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
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐Amazon Web Services
 
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017Amazon Web Services
 
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...Amazon Web Services
 
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)Amazon Web Services
 
CON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersCON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersAmazon Web Services
 
Application Performance Management on AWS
Application Performance Management on AWSApplication Performance Management on AWS
Application Performance Management on AWSAmazon Web Services
 

Mais procurados (20)

Building Manageable Windows Workloads - ARC324 - re:Invent 2017
Building Manageable Windows Workloads - ARC324 - re:Invent 2017Building Manageable Windows Workloads - ARC324 - re:Invent 2017
Building Manageable Windows Workloads - ARC324 - re:Invent 2017
 
Storage State of the Union - STG201 - re:Invent 2017
Storage State of the Union - STG201 - re:Invent 2017Storage State of the Union - STG201 - re:Invent 2017
Storage State of the Union - STG201 - re:Invent 2017
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWS
 
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...
SRV336_Build a Serverless, Face-Recognizing IoT Security System with Amazon R...
 
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
 
Improving Microservice and Serverless Observability with Monitoring Data - SR...
Improving Microservice and Serverless Observability with Monitoring Data - SR...Improving Microservice and Serverless Observability with Monitoring Data - SR...
Improving Microservice and Serverless Observability with Monitoring Data - SR...
 
Building Best Practices and the Right Foundation for your 1st Production Work...
Building Best Practices and the Right Foundation for your 1st Production Work...Building Best Practices and the Right Foundation for your 1st Production Work...
Building Best Practices and the Right Foundation for your 1st Production Work...
 
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
 
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
 
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...
GPSWKS408-GPS Migrate Your Databases with AWS Database Migration Service and ...
 
ALX328_Smart Devices Everywhere
ALX328_Smart Devices EverywhereALX328_Smart Devices Everywhere
ALX328_Smart Devices Everywhere
 
CTD403_Supercharge Your Websites with the Power of Lambda@Edge
CTD403_Supercharge Your Websites with the Power of Lambda@EdgeCTD403_Supercharge Your Websites with the Power of Lambda@Edge
CTD403_Supercharge Your Websites with the Power of Lambda@Edge
 
IOT312_A New Generation IoT Core Platform
IOT312_A New Generation IoT Core PlatformIOT312_A New Generation IoT Core Platform
IOT312_A New Generation IoT Core Platform
 
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...
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐
 
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
Reinforcement Learning – The Ultimate AI - ARC320 - re:Invent 2017
 
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...
GPSTEC321_VMware on AWS Cloud Technical Deep Dive & Native AWS Services Integ...
 
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)
How to Handle PCI and HIPAA Compliance with Serverless Architecture( SRV214)
 
CON203_Driving Innovation with Containers
CON203_Driving Innovation with ContainersCON203_Driving Innovation with Containers
CON203_Driving Innovation with Containers
 
Application Performance Management on AWS
Application Performance Management on AWSApplication Performance Management on AWS
Application Performance Management on AWS
 

Semelhante a CON318_Interstella 8888 Monolith to Microservices with Amazon ECS

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
 
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 AWSAmazon Web Services
 
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 AWSAmazon 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
 
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 2017Amazon Web Services
 
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 2017Amazon Web Services
 
IOT311_Customer Stories of Things, Cloud, and Analytics on AWS
IOT311_Customer Stories of Things, Cloud, and Analytics on AWSIOT311_Customer Stories of Things, Cloud, and Analytics on AWS
IOT311_Customer Stories of Things, Cloud, and Analytics on AWSAmazon Web Services
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSAmazon Web Services
 
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...Amazon Web Services
 
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...Amazon Web Services
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Amazon 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
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSAmazon Web Services
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudAdrian Hornsby
 
Journey to the Modern App with Containers, Microservices and Big Data
Journey to the Modern App with Containers, Microservices and Big DataJourney to the Modern App with Containers, Microservices and Big Data
Journey to the Modern App with Containers, Microservices and Big DataLightbend
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less OperationsDonnie Prakoso
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSAmazon Web Services
 

Semelhante a CON318_Interstella 8888 Monolith to Microservices with Amazon ECS (20)

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
 
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
 
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
 
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
 
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
 
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
 
IOT311_Customer Stories of Things, Cloud, and Analytics on AWS
IOT311_Customer Stories of Things, Cloud, and Analytics on AWSIOT311_Customer Stories of Things, Cloud, and Analytics on AWS
IOT311_Customer Stories of Things, Cloud, and Analytics on AWS
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Amazon Container Services
Amazon Container ServicesAmazon Container Services
Amazon Container Services
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWS
 
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...
Easy and Scalable Log Analytics with Amazon Elasticsearch Service - ABD326 - ...
 
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...
Accelerating Apache MXNet Models on Apple Platforms Using Core ML - MCL311 - ...
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
 
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...
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the Cloud
 
Journey to the Modern App with Containers, Microservices and Big Data
Journey to the Modern App with Containers, Microservices and Big DataJourney to the Modern App with Containers, Microservices and Big Data
Journey to the Modern App with Containers, Microservices and Big Data
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less Operations
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWS
 

Mais 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
 

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
 

CON318_Interstella 8888 Monolith to Microservices with Amazon ECS

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Interstella 8888: Monolith to Microservices with Amazon ECS H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t A n d y M u i , A W S S o l u t i o n s A r c h i t e c t D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t C O N 3 1 8 N o v e m b e r 2 8 , 2 0 1 7
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Monolith to Microservices with Amazon ECS H u b e r t C h e u n g , A W S S o l u t i o n s A r c h i t e c t A n d y M u i , A W S S o l u t i o n s A r c h i t e c t D a v i d K u o , A W S S o l u t i o n s A r c h i t e c t C O N 3 1 8
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ABOUT ME kuodavid@amazon.com Solutions Architect 2.7 years at AWS Based in Southern California
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT TO EXPECT Monolith versus Microservices Architectures Strangler Application Pattern Amazon EC2 Container Service (ECS) Hands-On Lab • Break Apart the Monolith • Independently
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WHAT ARE MICROSERVICES? “A software architecture style in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These services are small, highly decoupled and focus on doing a small task, facilitating a modular approach to system- building.” –Wikipedia Great article on the topic: https://martinfowler.com/articles/microservices.html Source: https://en.wikipedia.org/wiki/Microservices
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MONOLITHIC VERSUS MICROSERVICES Admin UI Orders Service Inventory Service Shipping Service Admin UI Orders Service Inventory Service Shipping Service Customer UI Customer UI
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MONOLITHIC CHALLENGES Admin UI Orders Service Inventory Service Shipping Service Customer UI Code Maintenance—large, complex code base, long dev cycles Deployments—lengthy, complicated process, often becomes the bottleneck Ownership—many developers, same codebase Scale—difficult to scale efficiently Tools—limited technology choices (for example, database, programming language) Dependencies—tight coupling, difficult to manage
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MICROSERVICES BENEFITS Admin UI Orders Service Inventory Service Shipping Service Customer UICode Maintenance—smaller units of code Deployments—each service has its own roadmap and pipeline Ownership—smaller teams own services Scale—each service can scale independently Tools—polyglot environment Dependencies—loose coupling, standardized communications
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MONOLITH TO MICROSERVICES Rewrite the app Look at all that technical debt and piled up cruft Is Bob the Wizard who wrote that glue code even still around? Potential downtime and risk for full cutover Let’s consider the Strangler Application Pattern for a more incremental approach… Source: https://xkcd.com/292/
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. STRANGLER APPLICATION PATTERN Gradually build something new alongside the monolith New functionality replaces methods in the monolith Over time, the new system “strangles” the old system, until the old dies out Ideal for web applications, API- structured applications, queue-based systems Source: https://en.wikipedia.org/wiki/Strangler_fig
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MICROSERVICES & CONTAINERS Portable units of work Simple to model Any app, any language Image is the version Test and deploy same artifact Stateless servers reduce change risk Admin UI Orders Service Inventory Service Shipping Service Customer UI
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS EC2 INSTANCES ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container Internet LOAD BALANCER LOAD BALANCER
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AMAZON ECS—TASK DEFINITION { "containerDefinitions": [ { "name": "wordpress", "links": [ "mysql" ], "image": "wordpress", "essential": true, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "memory": 500, "cpu": 10 }, { "name": "mysql", "image": "mysql", "cpu": 10, "memory": 500, Instructions used by ECS to launch containers JSON template Used to launch tasks and services Maps to docker run parameters
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. HANDS-ON LAB
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WELCOME TO INTERSTELLA 8888 Interstella 8888 is an intergalactic trading company that was established to import and export rare resources in the universe. Interstella was a thriving company, but business has been declining despite a booming economy. You and a few other consultants have been brought on board to turn this around. Will you be able to restore Interstella to its former glory?
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. YOUR MISSION Interstella 8888 operates a logistics platform to control the processing centers of the four rare resources—tiberium, vespene gas, spice melange, and dilithium crystals. We believe microservices will help us scale more efficiently and adopt a more agile development pipeline. We need your help to incrementally break down the monolith codebase and roll out the new microservices that our developers have been working on. Each microservice will be responsible for processing orders for a specific resource. Lab 1: Build and deploy monolith container using ECS Lab 2: Incrementally build and deploy each microservice Bonus Lab: Scale microservices with an Application Load Balancer (ALB)
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WORKSHOP ENVIRONMENT Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS Orders come into the logistics platform as HTTP POST messages via Amazon Simple Notification Service (Amazon SNS) Amazon S3 hosts web content and utilities—API key generator, order subscription, order dashboard The logistics platform communicates with an order fulfillment API running on Amazon API Gateway; order data is stored in Amazon DynamoDB Amazon CloudWatch
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 1 (ECS REFRESHER) Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB 1. Build a Docker image for the monolith from the provided Dockerfile; Push image to ECR 2. Create an ECS task definition to deploy the monolith image and log to CloudWatch Logs 3. Deploy the monolith using ECS M FULFILL Amazon CloudWatch Amazon ECR Amazon ECS LOGS
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 2 Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Build a Docker image for a resource microservice and store in ECR 2. Create an an ECS task definition to deploy the microservice image 3. Deploy the microservice image using ECS to start processing orders for that resource 4. Modify the monolith code to remove functionality of the microservice; rebuild the monolith image and re-deploy M FULFILL Amazon CloudWatch m FULFILL
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. BONUS LAB Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Create an Application Load Balancer (ALB) 2. Create an ECS service that ties in the ALB for routing orders to monolith and resource microservices; ALB will use path-based routing to route to each microservice target group 3. Repeat until all microservices are deployed M FULFILL Amazon CloudWatch Application Load Balancer m FULFILL /vespene /melange m
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LOGISTICS INSTRUCTIONS: http://interstella.trade/workshop2/ ORDERS TOPIC: arn:aws:sns:us-west-2:270206935686:monolith Raise your hand if you have any questions. High five your neighbors and have fun! Please fill out feedback forms once you are done! Feel free to email us with comments/questions/feedback: aws-interstella-team@amazon.com
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!