What to Expect from the Session • Microservices Architecture • Amazon ECS • The Twelve-Factor App with Amazon ECS
Microservices Architecture
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
https://en.wikipedia.org/wiki/Microservices
Monolithic vs. Microservices
Order UI
OrderUI
Shipping Service
Inventory Service
Order Service
Order Service Inventory Service Shipping Service .package webserver
Characteristics of Microservice Architectures Decentralized
Independent
Black box
Polyglot
Do one thing well
You build it, you run it
Why 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 • Integration with CloudWatch service for monitoring and logging • Integration with Code* services for continuous integration and delivery (CI/CD)
Deploying Containers on 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
TASK B TASK B EC2 System Manager – Parameter Store
ECS Cluster
Service Discovery with Route 53 and Application Load Balancers mydomain.com
mydomain.com/weather
mydomain.com
Application Load Balancer
mydomain.com/auth
i-aaa
i-bbb
8081 8080 oAuth Target Group
i-ccc 8080 Weather Target Group
i-aaa
i-bbb
i-ccc
8000
8001
8002
Portal Target Group ECS Cluster
Amazon Route 53
Consuming Events for Service Discovery app1-tst à 10.1.0.11 db1-tst à 10.1.0.14 app2 à 10.1.0.16 db2 à 10.1.0.18 my-app à 10.1.0.20 db-devà 10.1.0.19 websrv1à 10.1.0.1 websrv2à 10.1.0.2 websrv3à 10.1.0.4 app-dev1à 10.1.0.9 app-dev2à 10.1.0.5 app-dev3à 10.1.0.8