4. 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
6. Characteristics of Microservice Architectures
Do one
thing wellIndependent
Decentralized
Black box
Polyglot
You build it, you run it
7. 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)
8. 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
9. iCook 愛料理
Leading recipe sharing social network
- 5M+ MAU
- 4M+ app downloads worldwide
- 10k+ recipes / dishes uploaded monthly
10. Agile development for iCook 愛料理
With limited resource, we want to achieve:
1. Use hosted services as mush as possible
2. Easy to install cluster and manage
3. Continuous integration & deployment
12. Three major advantages
AWS integration
- Persistent data
- Auto scaling
- Load balancing
Lightweight agent
- Just an image
- Open source
Great SDKs
- Same AWS SDKs
- Easy auth
- Good docs
13. Start using ECS today!
Some time saving tips:
1. Use ECS optimized images
2. Plan auto scaling and load balancing from beginning
3. Learn ECS APIs from SDK
14. Amazon ECS: Under the Hood
ALB ALB
AZ 1 AZ 2
user / scheduler
Scheduler
Cluster State Service
Placement Engine
Event Stream
25. Example Microservice Architecture on ECS
Amazon
ECR
Amazon
RDS
Application Load
Balancer
ECS Cluster
ECS Cluster
IAM
Amazon API
Gateway*
Amazon
Route 53
Amazon CloudWatch
26. Automatic Service Scaling
Publish metrics
Auto Scaling ECS service
Availability
Zone A
Availability
Zone B
TASK A
Add/Remove ECS
tasks
TASK C
TASK BScaling Policies
Amazon
CloudWatch
Amazon ECS
Application
Load Balancer
27. IAM Roles For Tasks
ECS Cluster
EC2 Instance EC2 Instance
TASK A
TASK B
TASK B
Amazon
DynamoDB
Amazon
S3