9. Containers Flashcards
Three reasons tightly-coupled monolithic architectures are bad.
- Less resilient
- Harder to scale
- Slower feature delivery (1)
(1): Conway’s Law - https://en.wikipedia.org/wiki/Conway%27s_law
Best alternative to monoliths?
Microservices approach
Describe microservices approach
Based on a **collection of small services **:
- Specialized for a single purpose
- Self-contained code and functionality
- Loosely coupled via load-balancing
- Well-defined APIs for communication
- Autonomous deployment and scaling
https://docs.aws.amazon.com/whitepapers/latest/microservices-on-aws/simple-microservices-architecture-on-aws.html
How to manually run containers on an EC2 instance?
- Deploy an EC2 instance
- Install a container runtime
- Build & run containers
The 3 components of a managed container solution?
- Container registry
- Orchestration tool (control plane)
- Container hosting (data plane)
What is a container registry?
A collection of repositories that store container images.
What is the AWS container registry service called?
Amazon ECR
What container orchestration services does AWS offer?
- ECS
- EKS
When to use ECS vs. EKS?
- ECS - Best if you are primarily AWS.
- EKS - Best for interoperating with on-prem or other cloud providers.
What container hosting options does AWS offer?
- EC2
- Fargate
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html
For ECS, the hosting options are also called:
Launch type
Because that is the type of hosting resource the container will be *
Advantages of using EC2 clusters for hosting containers?
- Control over instance type
- Usually more cost effective
EC2 is more cost effective unless you run a very small number of containers per application
(See: https://docs.google.com/spreadsheets/d/1th6E9N96IlKpmoFyQivPkBAdRvFzr4zlseB4ZzI9-hQ/edit?usp=sharing)
Advantages of using Fargate for hosting containers?
- Zero management of host resources
What are the key components of ECS?
- Services - your applications
- Tasks - container instances
- Cluster EC2 host cluster (optional)
- ECR Registry
Four benefits of ECS?
- Service discovery
- AWS integrations
- Flexible hosting (EC2/Fargate)
- CI/CD workflows
Service Discovery: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html