-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevops
More file actions
101 lines (56 loc) · 2.85 KB
/
Devops
File metadata and controls
101 lines (56 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
1 -> Deployment Strategies for Any App
From startup to scale, deploy containers to AWS using the infrastructure your team requires.
Get your app line fast with AWS App Runner.
Evolve your CI/CD pipeline to ECS with Terraform, and manage your infrastructure with code.
2 -> Automation and Optimization
A growing team and application need automation. Add database migrations and a makefile for improved developer ergonomics.
Optimize the container with multi-stage Docker builds for faster deployments.
3 -> Build a Deployment Pipeline
Master GitHub Actions. Configure blue/green deployments for multiple environments.
Use branches and tags to promote successful deployments to production and ship confidently with a robust CI/CD pipeline.
4 -> Migrate your database to RDS. Scale your application with ECS clusters, load balancing, and a CloudFront CDN.
Learn the infrastructure required to ship high-performance enterprise applications.
---------------------------------------------
🪜 Analogy
EC2 = a single worker who can do many tasks, but you must tell them everything.
ECS = a manager who can supervise many workers, assign them tasks automatically, and replace them if they fail.
⚙️ Why we don’t just use EC2 directly in big applications
Automatic scaling
ECS can start more containers if traffic increases and stop them when it drops.
On EC2 alone, you’d have to do this manually.
High availability
ECS can restart failed containers automatically.
On EC2 alone, if your process crashes, nothing restarts it unless you manually intervene.
Simplified deployment
ECS lets you deploy multiple versions of your app easily with tasks and services.
On EC2, you’d have to SSH into every instance and update manually.
Resource efficiency
ECS can pack multiple containers onto fewer EC2 instances, saving cost.
On EC2 alone, you might run one app per instance, wasting resources.
Integration with AWS services
ECS can automatically use IAM roles, CloudWatch logs, Auto Scaling, ALB, etc.
On EC2 alone, you have to configure all of that yourself.
🧩 In short
EC2 = “I have a server, I do everything myself.”
ECS = “I give my app as containers to AWS, and it runs, scales, and manages them for me.”
1️⃣ Using EC2 directly
Client → EC2 Instance
├─ App1
├─ App2
└─ App3
You have to:
- Install apps manually
- Start/stop them manually
- Scale manually
- Monitor manually
---
2️⃣ Using ECS with EC2 instances
Client → Load Balancer → ECS Cluster (group of EC2 instances)
├─ Container A (App1)
├─ Container B (App2)
└─ Container C (App3)
ECS automatically:
- Schedules containers on instances
- Restarts failed containers
- Scales up/down
- Monitors health