This document discusses 12 factor application principles for building microservices and outlines best practices for microservice architecture. It covers 12 factors like codebase, dependencies, configuration, backing services, port binding, concurrency, disposability, and others. It also discusses microservice principles like componentization, decentralization, treating services as products not projects, and infrastructure automation. The document provides examples of how to structure user signup as independent microservices that communicate asynchronously through events.
47. 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
61. 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
65. Each component is a 12 factor application.
Fast Launch
Dependencies Configuration Port BindingCodebase
ConcurrentGraceful stop Log stream
Stateless
81. Example: User Signup
Signup API
HTTP
User Metadata
Service
Password
Service
Email Verification
Service
Friend Discovery
Service
Asynchronous
Broadcast
86. 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
87. Developers Version Control Repository
Test & Deployment
Manager
Image Build Service
Infrastructure Provisioning
Container Scheduling &
Orchestration
Container Image Repository