SlideShare uma empresa Scribd logo
1 de 41
©	2017,	Amazon	Web	Services,	Inc.	or	its	Affiliates,	All	rights	reserved.	
Microservices on AWS
Steve Sofian, Solutions Architect WWPS
What to Expect from the Session
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
• Review microservices architecture and how it differs
from monolithic and service-oriented architectures
• Examine the challenges in running microservices at
scale
• Demonstrate how to run microservices on AWS
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
The Monolithic Architecture
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
The Service-Oriented Architecture
Presentation Tier Logic Tier
Data Tier
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
The Microservices Architecture
What are containers?
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Docker Datacenter on AWS
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Amazon EC2 instances Amazon EC2 instances
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Challenges in running
Microservices
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Microservice Challenge #1 – Resource Management
Managing a large fleet by hand is impossible:
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
AZ 1 AZ 2
AZ 3
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Microservices Challenge #2 – Monitoring
A microservices architecture will have 10s, 100s, 1000s,
maybe even 10,000s of individual services:
• How do you know if an individual service is healthy?
• How do you measure the performance of an individual
service?
• How do you troubleshoot and debug an individual
service?
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Microservices Challenge #3: Service Discovery
Each microservice scales up and down independently of
one another:
• How does Service A know the URLs for all instances of
Service B?
• How do you allow services to scale independently while
still using load balancers?
• How does a new instance of a service announce itself to
other services?
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Microservices Challenge #4: Deployment
A microservices architecture will have 10s, 100s, 1000s,
maybe even 10,000s of individual services:
• Each service will be developed, tested, and deployed on
its own timeline – How do you manage this across large
numbers of services?
• Services are polyglot – different languages, frameworks
– how do you efficiently deploy them?
• How do you decide which hosts to deploy a service on?
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Introducing Amazon ECS
• Fully managed elastic service – You don’t need
to run anything, and the service scales as your
microservices architecture grows
• Shared state optimistic scheduling
• Fully ACID compliant resource and state
management
• Integration with CloudWatch service for
monitoring and logging
• Integration with Code* services for continuous
integration and delivery (CI/CD)
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Amazon ECS Architecture
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Amazon ECS Architecture
Amazon VPC Container
Amazon ECS
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Example Microservice Architecture on ECS
Amazon ECS Amazon ECR
Amazon API Gateway
Amazon RDS
DB Instance
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Monitoring with Amazon CloudWatch
Metric data sent to CloudWatch in 1-minute periods and
recorded for a period of two weeks
Available metrics: CPUReservation, MemoryReservation,
CPUUtilization, MemoryUtilization
Available dimensions: ClusterName, ServiceName
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Monitoring with Amazon CloudWatch
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Service
Discovery
with Route
53 and
Application
Load
Balancers
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Deploying Containers on Amazon ECS – Choose a
Scheduler
Batch Jobs
ECS task scheduler
Run tasks once
Batch jobs
RunTask (random)
StartTask (placed)
Long-Running Apps
ECS service scheduler
Health management
Scale-up and scale-down
AZ aware
Grouped containers
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Continuous Delivery to Amazon ECS with Jenkins
4. Push image to
Docker registry
2. Build image
from sources
3. Run test on image
1. Code push
triggers build
5. Update service
6. Pull image
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Continuous Delivery to Amazon ECS with Jenkins
Easy Deployment
Developers – Merge into master, done!
Jenkins Build Steps
Trigger via webhooks, monitoring, Lambda
Build Docker image via build and publish plugin
Push Docker image into registry
Register updated job with ECS API
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
But….
many of these tools and
innovations are still coupled to
a shared dependency…
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Servers (AAHHHHHHHHH!!)
What size servers are right for
my budget?
How many users create too
much load for my servers?
How much remaining capacity
do my servers have?
How can I detect if a server has
been compromised?
How many servers
should I budget for?
Which OS should my
servers run?
Which users should have
access to my servers?
How can I control access from
my servers?
How will I keep my server
OS patched?
How will new code be
deployed to my servers?
How can I increase
utilization of my servers?
When should I decide to
scale out my servers?
What size server is
right for my performance?
Should I tune OS settings
to optimize my application?
Which packages should be
baked into my server images?
When should I decide to
scale up my servers?
How should I handle server
configuration changes?
How will the application handle
server hardware failure?
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Architect to be Serverless
Fully managed
• No provisioning
• Zero administration
• High availability
Developer productivity
• Focus on the code that
matters
• Innovate rapidly
• Reduce time to market
Continuous scaling
• Automatically
• Scale up and scale down
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
AWS Lambda
Serverless, event-driven compute service
Lambda = microservice without servers
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Components of Lambda
• A Lambda function (that you write)
• An event source
• The AWS Lambda service
• The function networking environment
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Lambda Function
• Your code
(Java, NodeJS, Python, C#)
• The IAM role that code
assumes during execution
• The amount of memory
allocated to your code
(affects CPU and network
as well)
A valid, complete
Lambda function
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Event Sources
• When should your function
execute?
• Many AWS services can be
an event source today:
• Amazon S3
• Amazon Kinesis
• Amazon SNS
• Amazon DynamoDB
• Amazon CloudWatch
• AWS Config Rules
• Amazon Echo
• Etc.
• …and Amazon API
Gateway (more later)
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
AWS Lambda
• Runs your function code without you managing or
scaling servers.
• Provides an API to trigger the execution of your function.
• Ensures function is executed when triggered, in parallel,
regardless of scale.
• Provides additional capabilities for your function
(logging, monitoring).
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
“But…
in order to utilize Lambda, do I really
need to architect event-driven
applications?” – you (maybe)
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
SOA still works.
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Amazon API Gateway
A Fully Managed Service for Your APIs
Create Configure Publish
Maintain Monitor Secure
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Serverless Image Handler
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Microservices Architecture (Serverless)
© 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
Go build something!
Amazon API
Gateway
AWS Lambda Amazon
DynamoDB
©	2017,	Amazon	Web	Services,	Inc.	or	its	Affiliates,	All	rights	reserved.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS
 
AWS FSI Symposium 2017 NYC - Amazon AI for FS
AWS FSI Symposium 2017 NYC - Amazon AI for FSAWS FSI Symposium 2017 NYC - Amazon AI for FS
AWS FSI Symposium 2017 NYC - Amazon AI for FS
 
WPS301-Navigating HIPAA and HITRUST_QuickStart Guide to Account Gov Strat.pdf
WPS301-Navigating HIPAA and HITRUST_QuickStart Guide to Account Gov Strat.pdfWPS301-Navigating HIPAA and HITRUST_QuickStart Guide to Account Gov Strat.pdf
WPS301-Navigating HIPAA and HITRUST_QuickStart Guide to Account Gov Strat.pdf
 
Simplify & Standardise Your Migration to AWS with a Migration Landing Zone
Simplify & Standardise Your Migration to AWS with a Migration Landing ZoneSimplify & Standardise Your Migration to AWS with a Migration Landing Zone
Simplify & Standardise Your Migration to AWS with a Migration Landing Zone
 
WIN302-Deep Dive on Active Directory From One to Many AWS Regions.pdf
WIN302-Deep Dive on Active Directory From One to Many AWS Regions.pdfWIN302-Deep Dive on Active Directory From One to Many AWS Regions.pdf
WIN302-Deep Dive on Active Directory From One to Many AWS Regions.pdf
 
Media and Entertainment Industry Day Keynote - Bhavik Vyas
Media and Entertainment Industry Day Keynote - Bhavik VyasMedia and Entertainment Industry Day Keynote - Bhavik Vyas
Media and Entertainment Industry Day Keynote - Bhavik Vyas
 
AWS re:Invent recap
AWS re:Invent recapAWS re:Invent recap
AWS re:Invent recap
 
Soup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWSSoup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWS
 
Module 1: AWS Introduction and History - AWSome Day Online Conference - APAC
Module 1: AWS Introduction and History - AWSome Day Online Conference - APACModule 1: AWS Introduction and History - AWSome Day Online Conference - APAC
Module 1: AWS Introduction and History - AWSome Day Online Conference - APAC
 
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
Module 3: Security, Identity and Access Management - AWSome Day Online Confer...
 
AWS Innovate Ottawa: Security & Compliance
AWS Innovate Ottawa: Security & ComplianceAWS Innovate Ottawa: Security & Compliance
AWS Innovate Ottawa: Security & Compliance
 
WIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWSWIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWS
 
SID344-Soup to Nuts Identity Federation for AWS
SID344-Soup to Nuts Identity Federation for AWSSID344-Soup to Nuts Identity Federation for AWS
SID344-Soup to Nuts Identity Federation for AWS
 
Security Innovations in the Cloud
Security Innovations in the CloudSecurity Innovations in the Cloud
Security Innovations in the Cloud
 
GPSBUS214-Key Considerations for Cloud Procurement in the Public Sector
GPSBUS214-Key Considerations for Cloud Procurement in the Public SectorGPSBUS214-Key Considerations for Cloud Procurement in the Public Sector
GPSBUS214-Key Considerations for Cloud Procurement in the Public Sector
 
GPSBUS204_Building a Profitable Next Generation AWS MSP Practice
GPSBUS204_Building a Profitable Next Generation AWS MSP PracticeGPSBUS204_Building a Profitable Next Generation AWS MSP Practice
GPSBUS204_Building a Profitable Next Generation AWS MSP Practice
 
Module 1 - AWSome Day Online Conference Thailand
Module 1 - AWSome Day Online Conference Thailand Module 1 - AWSome Day Online Conference Thailand
Module 1 - AWSome Day Online Conference Thailand
 
Getting Started with AWS for Developers
Getting Started with AWS for DevelopersGetting Started with AWS for Developers
Getting Started with AWS for Developers
 
The Transformation Journey with Cloud Technology
The Transformation Journey with Cloud TechnologyThe Transformation Journey with Cloud Technology
The Transformation Journey with Cloud Technology
 
Security & Compliance in the cloud
Security & Compliance in the cloudSecurity & Compliance in the cloud
Security & Compliance in the cloud
 

Semelhante a Navigating Microservice Architecture with AWS - AWS Public Sector Summit Singapore 2017

How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
Amazon Web Services
 
Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2
Amazon Web Services
 

Semelhante a Navigating Microservice Architecture with AWS - AWS Public Sector Summit Singapore 2017 (20)

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
 
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
 
What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017
 
Dive deep into technical enhancements - re:Invent Come to London 2.0
Dive deep into technical enhancements - re:Invent Come to London 2.0Dive deep into technical enhancements - re:Invent Come to London 2.0
Dive deep into technical enhancements - re:Invent Come to London 2.0
 
Introduction to the Serverless Cloud
Introduction to the Serverless CloudIntroduction to the Serverless Cloud
Introduction to the Serverless Cloud
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
 
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
Moving to Amazon ECS – the Not-So-Obvious Benefits - CON356 - re:Invent 2017
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
 
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
 
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 Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL MeetupIntroduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless Architecture
 
End-User Computing on AWS with Amazon WorkSpaces and Amazon AppStream 2.0 - E...
End-User Computing on AWS with Amazon WorkSpaces and Amazon AppStream 2.0 - E...End-User Computing on AWS with Amazon WorkSpaces and Amazon AppStream 2.0 - E...
End-User Computing on AWS with Amazon WorkSpaces and Amazon AppStream 2.0 - E...
 
Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2
 
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-...
 
ARC205_Born in the Cloud
ARC205_Born in the CloudARC205_Born in the Cloud
ARC205_Born in the Cloud
 
Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...
 
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
 
Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018
 

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
 

Navigating Microservice Architecture with AWS - AWS Public Sector Summit Singapore 2017

  • 2. What to Expect from the Session © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. • Review microservices architecture and how it differs from monolithic and service-oriented architectures • Examine the challenges in running microservices at scale • Demonstrate how to run microservices on AWS
  • 3. © 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
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. The Monolithic Architecture
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. The Service-Oriented Architecture Presentation Tier Logic Tier Data Tier
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. The Microservices Architecture
  • 7. What are containers? © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
  • 8. Docker Datacenter on AWS © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Amazon EC2 instances Amazon EC2 instances
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Challenges in running Microservices
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Microservice Challenge #1 – Resource Management Managing a large fleet by hand is impossible: Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS AZ 1 AZ 2 AZ 3
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Microservices Challenge #2 – Monitoring A microservices architecture will have 10s, 100s, 1000s, maybe even 10,000s of individual services: • How do you know if an individual service is healthy? • How do you measure the performance of an individual service? • How do you troubleshoot and debug an individual service?
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Microservices Challenge #3: Service Discovery Each microservice scales up and down independently of one another: • How does Service A know the URLs for all instances of Service B? • How do you allow services to scale independently while still using load balancers? • How does a new instance of a service announce itself to other services?
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Microservices Challenge #4: Deployment A microservices architecture will have 10s, 100s, 1000s, maybe even 10,000s of individual services: • Each service will be developed, tested, and deployed on its own timeline – How do you manage this across large numbers of services? • Services are polyglot – different languages, frameworks – how do you efficiently deploy them? • How do you decide which hosts to deploy a service on?
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Introducing Amazon ECS • Fully managed elastic service – You don’t need to run anything, and the service scales as your microservices architecture grows • Shared state optimistic scheduling • Fully ACID compliant resource and state management • Integration with CloudWatch service for monitoring and logging • Integration with Code* services for continuous integration and delivery (CI/CD)
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Amazon ECS Architecture
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Amazon ECS Architecture Amazon VPC Container Amazon ECS
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Example Microservice Architecture on ECS Amazon ECS Amazon ECR Amazon API Gateway Amazon RDS DB Instance
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Monitoring with Amazon CloudWatch Metric data sent to CloudWatch in 1-minute periods and recorded for a period of two weeks Available metrics: CPUReservation, MemoryReservation, CPUUtilization, MemoryUtilization Available dimensions: ClusterName, ServiceName
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Monitoring with Amazon CloudWatch
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Service Discovery with Route 53 and Application Load Balancers
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Deploying Containers on Amazon ECS – Choose a Scheduler Batch Jobs ECS task scheduler Run tasks once Batch jobs RunTask (random) StartTask (placed) Long-Running Apps ECS service scheduler Health management Scale-up and scale-down AZ aware Grouped containers
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Continuous Delivery to Amazon ECS with Jenkins 4. Push image to Docker registry 2. Build image from sources 3. Run test on image 1. Code push triggers build 5. Update service 6. Pull image
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Continuous Delivery to Amazon ECS with Jenkins Easy Deployment Developers – Merge into master, done! Jenkins Build Steps Trigger via webhooks, monitoring, Lambda Build Docker image via build and publish plugin Push Docker image into registry Register updated job with ECS API
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. But…. many of these tools and innovations are still coupled to a shared dependency…
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Servers (AAHHHHHHHHH!!) What size servers are right for my budget? How many users create too much load for my servers? How much remaining capacity do my servers have? How can I detect if a server has been compromised? How many servers should I budget for? Which OS should my servers run? Which users should have access to my servers? How can I control access from my servers? How will I keep my server OS patched? How will new code be deployed to my servers? How can I increase utilization of my servers? When should I decide to scale out my servers? What size server is right for my performance? Should I tune OS settings to optimize my application? Which packages should be baked into my server images? When should I decide to scale up my servers? How should I handle server configuration changes? How will the application handle server hardware failure?
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Architect to be Serverless Fully managed • No provisioning • Zero administration • High availability Developer productivity • Focus on the code that matters • Innovate rapidly • Reduce time to market Continuous scaling • Automatically • Scale up and scale down
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. AWS Lambda
  • 28. Serverless, event-driven compute service Lambda = microservice without servers
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Components of Lambda • A Lambda function (that you write) • An event source • The AWS Lambda service • The function networking environment
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Lambda Function • Your code (Java, NodeJS, Python, C#) • The IAM role that code assumes during execution • The amount of memory allocated to your code (affects CPU and network as well) A valid, complete Lambda function
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Event Sources • When should your function execute? • Many AWS services can be an event source today: • Amazon S3 • Amazon Kinesis • Amazon SNS • Amazon DynamoDB • Amazon CloudWatch • AWS Config Rules • Amazon Echo • Etc. • …and Amazon API Gateway (more later)
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. AWS Lambda • Runs your function code without you managing or scaling servers. • Provides an API to trigger the execution of your function. • Ensures function is executed when triggered, in parallel, regardless of scale. • Provides additional capabilities for your function (logging, monitoring).
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. “But… in order to utilize Lambda, do I really need to architect event-driven applications?” – you (maybe)
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. SOA still works.
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Amazon API Gateway
  • 36. A Fully Managed Service for Your APIs Create Configure Publish Maintain Monitor Secure © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
  • 37. Serverless Image Handler © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved.
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Demo
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Microservices Architecture (Serverless)
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates, All rights reserved. Go build something! Amazon API Gateway AWS Lambda Amazon DynamoDB