SlideShare ist ein Scribd-Unternehmen logo
1 von 93
AWS Webinars
Building Microservices with the
12 Factor App Pattern on AWS
Abby Fuller
Developer Relations, AWS
12 Factor App
Principles
Microservice
Principles
Great, Scalable
Architecture
+ =
12 Factor Application:
Codebase
Code
Code Version Control
Code Deployed VersionVersion Control
Staging / QA
Production
Dev #1
Dev #2
12 Factor Application:
Dependencies
Dependencies
Binaries
Code Application
Bundle
Dependency Declaration: Node.js
package.json
npm install
Dependency Declaration: Python
requirements.txt
pip install
Dependency Declaration: Ruby
Gemfile
bundle install
Dependency Isolation
Never depend on the host to
have your dependency.
Application deployments
should carry all their
dependencies with them.
Dependencies
Binaries
Code
Dependency Declaration & Isolation: Docker
docker build
Dockerfile
Development
Production
docker run
12 Factor Application:
Config
Development
Configuration
Production
Configuration
Development
Production
Development
Configuration
Production
Configuration
Development
Production
ANTIPATTERN
Development
Production
Same container deployed to both environments.
Configuration is part of the environment on the host.
At runtime the container gets config from the environment.
Application code pulls from the environment
Environment is customized when docker runs a container
12 Factor Application:
Backing Services
AWS S3
PostgreSQLapp1
Host
app2 3rd party service
Treat local services just like
remote third party ones
PostgreSQLapp1
app2
postgres.mycompany.com
app2.mycompany.com Load balancer
Use CNAMES for maximum
flexibility and reconfigurability
12 Factor Application:
Build, Release, Run
Dependencies
Binaries
Code
Build
Release
Config
+ =
Release
Build Artifact
Amazon Elastic Container Service
Config
Task Definition
Release v1.0.0
Run
Task Definition
Release v1.0.1
12 Factor Application:
Stateless Processes
Stateful container stores state in local disk or local memory.
Workload ends up tied to a specific host that has state data.
Stateful container stores state in local disk or local memory.
Workload ends up tied to a specific host that has state data.
ANTIPATTERN
Database
Durable store of truth.
MySQL, PostgreSQL,
MongoDB, DynamoDB
Cache
Fast, temporary
state store.
redis, memcached
12 Factor Application:
Port Binding
Port 32456
Port 32457
Port 32458
12 Factor Application:
Concurrency
WebAPI Worker
Worker
Web
API
Hosts
Processes
Hosts
Processes
Large Host = More
Concurrent Processes
Small Host =
Fewer Concurrent
Processes
12 Factor Application:
Disposability
Responsive
Graceful
ShutdownFast Launch
Fast Launch
Minimize the startup time of processes:
- Scale up faster in response to spikes
- Ability to move processes to another host as needed
- Replace crashed processes faster
Responsive, Graceful Shutdown
Should respond to SIGTERM by shutting down gracefully
12 Factor Application:
Dev/Prod Parity
Staging / QA
Production
Dev #1
Dev #2
Staging / QA
Production
Dev #1
Dev #2
Local Application Remote
12 Factor Application:
Logs
Treat logs as an event stream,
and keep the logic for routing
and processing logs separate
from the application itself.
Logging Library
Application Code
Process
Logging Library
Application Code
Process
Some logs get lost
if they haven’t
fully flushed
Logging Library
Application Code
Process
Some logs get lost
if they haven’t
fully flushed
ANTIPATTERN
Processes
Logging Agent
Application Code
Logs go to an
agent which
handles exporting
them off the host
Processes
Logging Agent
Application Code
Logs still reach
agent, and still
make it into ELK
stack
Containerized code writes to stdout
Docker connects container’s stdout to
a log driver
12 Factor Application:
Admin Processes
Admin / management processes are
inevitable:
- Migrate database
- Repair some broken data
- Once a week move database
records older than X to cold
storage
- Every day email a report to this
person
Run admin processes
just like other
processes.
Microservices:
Componentization
Each component is a 12 factor application.
Fast Launch
Dependencies Configuration Port BindingCodebase
ConcurrentGraceful stop Log stream
Stateless
Microservices:
Organized around capabilities
Identify the capabilities of the platform
Each major capability of the platform becomes a
component that is its own 12 factor app
Microservices:
Decentralized Governance
Microservices:
Products Not Projects
Products grow over time
Microservices are an
ecosystem of connected
products that can be at
different stages of growth
Don’t create throwaway microservices that become
unmaintained and break the ecosystem.
Microservices:
Smart endpoints, Dumb pipes
Central bus for communication
Bottlenecks performance and
feature development
Central bus for communication
Bottlenecks performance and
feature development
Decentralization
Example: User Signup
Signup API
HTTP
User Metadata
Service
Password
Service
Email Verification
Service
Friend Discovery
Service
Asynchronous
Broadcast
Event Producers SubscriptionsEvent Topics Queues Event Consumers
Amazon Managed Service for Microservice Communication
Microservices:
Infrastructure Automation
Automate the container build process:
Jenkins
AWS CodeBuild
Automate the provisioning of the
servers that host microservice
containers:
Terraform, Ansible,
Amazon CloudFormation
Automate the placement of
containerized service processes onto
hosts:
Amazon Elastic Container Service,
Kubernetes, Docker Swarm
Developers Version Control Repository
Test & Deployment
Manager
Image Build Service
Infrastructure Provisioning
Container Scheduling &
Orchestration
Container Image Repository
Developers AWS CodeCommit
AWS CodePipeline
AWS CodeBuild
AWS CloudFormation
Amazon ECS
Amazon ECR
Developers Github Jenkins
Terraform
Container Scheduling &
Orchestration with
Kubernetes
Container Image Repository
Summary
12 factor application principles
Fast Launch
Dependencies Configuration Port BindingCodebase
ConcurrentGraceful stop Log stream
Stateless
Microservice principles
Automation Componentization Product Focused
Decentralization
Thank you!
abbyfull@amazon.com
abbyfuller
abby-fuller

Weitere ähnliche Inhalte

Was ist angesagt?

運用AWS無伺服器架構建立車聯網平台
運用AWS無伺服器架構建立車聯網平台運用AWS無伺服器架構建立車聯網平台
運用AWS無伺服器架構建立車聯網平台
Amazon Web Services
 
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle SafetyHarnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
Amazon Web Services
 

Was ist angesagt? (19)

Sap Leonardo IoT Overview
Sap Leonardo IoT OverviewSap Leonardo IoT Overview
Sap Leonardo IoT Overview
 
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - ConclusionInternet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
 
AWS Summit Singapore - Opening Keynote by Dr. Werner Vogels
AWS Summit Singapore - Opening Keynote by Dr. Werner VogelsAWS Summit Singapore - Opening Keynote by Dr. Werner Vogels
AWS Summit Singapore - Opening Keynote by Dr. Werner Vogels
 
Derive Insight from IoT data in minute with AWS
Derive Insight from IoT data in minute with AWSDerive Insight from IoT data in minute with AWS
Derive Insight from IoT data in minute with AWS
 
Bringing the Internet of Things “IoT” to Government: Enabling Smart Nations
Bringing the Internet of Things “IoT” to Government: Enabling Smart NationsBringing the Internet of Things “IoT” to Government: Enabling Smart Nations
Bringing the Internet of Things “IoT” to Government: Enabling Smart Nations
 
AWS Intelligent at Edge for IoT
AWS Intelligent at Edge for IoTAWS Intelligent at Edge for IoT
AWS Intelligent at Edge for IoT
 
Intel IoT Edge Computing 在 AI 領域的應用與商機
Intel IoT Edge Computing 在 AI 領域的應用與商機Intel IoT Edge Computing 在 AI 領域的應用與商機
Intel IoT Edge Computing 在 AI 領域的應用與商機
 
Hybrid Cloud – Enabling a Borderless Data Center for Your Business
Hybrid Cloud – Enabling a Borderless Data Center for Your BusinessHybrid Cloud – Enabling a Borderless Data Center for Your Business
Hybrid Cloud – Enabling a Borderless Data Center for Your Business
 
運用AWS無伺服器架構建立車聯網平台
運用AWS無伺服器架構建立車聯網平台運用AWS無伺服器架構建立車聯網平台
運用AWS無伺服器架構建立車聯網平台
 
Mission Critical Applications Workloads on Amazon Web Services
Mission Critical Applications Workloads on Amazon Web ServicesMission Critical Applications Workloads on Amazon Web Services
Mission Critical Applications Workloads on Amazon Web Services
 
Real-time Visibility at Scale with Sumo Logic
Real-time Visibility at Scale with Sumo LogicReal-time Visibility at Scale with Sumo Logic
Real-time Visibility at Scale with Sumo Logic
 
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle SafetyHarnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
Harnessing AI and Computer Vision Technologies to Enhanced Vehicle Safety
 
ADLINK “AIoT at the EDGE”
ADLINK “AIoT at the EDGE”ADLINK “AIoT at the EDGE”
ADLINK “AIoT at the EDGE”
 
AWS Big Data Platform - Pop-up Loft Tel Aviv
AWS Big Data Platform - Pop-up Loft Tel AvivAWS Big Data Platform - Pop-up Loft Tel Aviv
AWS Big Data Platform - Pop-up Loft Tel Aviv
 
Integrierte Anwendungsfälle - Von der einzelnen Nachricht, über zeitnahe Anal...
Integrierte Anwendungsfälle - Von der einzelnen Nachricht, über zeitnahe Anal...Integrierte Anwendungsfälle - Von der einzelnen Nachricht, über zeitnahe Anal...
Integrierte Anwendungsfälle - Von der einzelnen Nachricht, über zeitnahe Anal...
 
Smart Cities: Open Grid | AWS Public Sector Summit 2016
Smart Cities: Open Grid | AWS Public Sector Summit 2016Smart Cities: Open Grid | AWS Public Sector Summit 2016
Smart Cities: Open Grid | AWS Public Sector Summit 2016
 
Cloud of Today is Built on People’s Data. Cloud of Tomorrow will be Built on ...
Cloud of Today is Built on People’s Data. Cloud of Tomorrow will be Built on ...Cloud of Today is Built on People’s Data. Cloud of Tomorrow will be Built on ...
Cloud of Today is Built on People’s Data. Cloud of Tomorrow will be Built on ...
 
Derive Insight from IoT data in minute with AWS
Derive Insight from IoT data in minute with AWSDerive Insight from IoT data in minute with AWS
Derive Insight from IoT data in minute with AWS
 
3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero 3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero
 

Ähnlich wie Building Microservices with the 12 Factor App Pattern on AWS - AWS Online Tech Talks

Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 
The missing piece : when Docker networking and services finally unleashes so...
 The missing piece : when Docker networking and services finally unleashes so... The missing piece : when Docker networking and services finally unleashes so...
The missing piece : when Docker networking and services finally unleashes so...
Adrien Blind
 

Ähnlich wie Building Microservices with the 12 Factor App Pattern on AWS - AWS Online Tech Talks (20)

Building Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWSBuilding Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWS
 
Building Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWSBuilding Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWS
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application Architecture
 
DockerCon EU 2015: The Missing Piece: when Docker networking unleashing soft ...
DockerCon EU 2015: The Missing Piece: when Docker networking unleashing soft ...DockerCon EU 2015: The Missing Piece: when Docker networking unleashing soft ...
DockerCon EU 2015: The Missing Piece: when Docker networking unleashing soft ...
 
Twelve Factor App
Twelve Factor AppTwelve Factor App
Twelve Factor App
 
DockerCon - The missing piece : when Docker networking unleashes software arc...
DockerCon - The missing piece : when Docker networking unleashes software arc...DockerCon - The missing piece : when Docker networking unleashes software arc...
DockerCon - The missing piece : when Docker networking unleashes software arc...
 
The missing piece : when Docker networking and services finally unleashes so...
 The missing piece : when Docker networking and services finally unleashes so... The missing piece : when Docker networking and services finally unleashes so...
The missing piece : when Docker networking and services finally unleashes so...
 
Micro-services meetup
Micro-services meetupMicro-services meetup
Micro-services meetup
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
Back to the Future: Containerize Legacy Applications
Back to the Future: Containerize Legacy ApplicationsBack to the Future: Containerize Legacy Applications
Back to the Future: Containerize Legacy Applications
 
Meteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container EngineMeteor South Bay Meetup - Kubernetes & Google Container Engine
Meteor South Bay Meetup - Kubernetes & Google Container Engine
 
56K.cloud Docker Training
56K.cloud Docker Training56K.cloud Docker Training
56K.cloud Docker Training
 
"Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?""Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?"
 
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
AWS Dev Lounge: Applying the Twelve-Factor Application Manifesto to Developin...
 
Build12 factorappusingmp
Build12 factorappusingmpBuild12 factorappusingmp
Build12 factorappusingmp
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Building Cloud Native Applications with Oracle Autonomous Database.
Building Cloud Native Applications with Oracle Autonomous Database.Building Cloud Native Applications with Oracle Autonomous Database.
Building Cloud Native Applications with Oracle Autonomous Database.
 
Hello cloud 6
Hello  cloud 6Hello  cloud 6
Hello cloud 6
 

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
 

Building Microservices with the 12 Factor App Pattern on AWS - AWS Online Tech Talks