aws sap 문제 풀이 3주차 문제풀이 1번
aws, sap, March 12, 2023
문제
A company wants to host its internal web application in AWS. The front-end uses Docker containers and it connects to a MySQL instance as the backend database. The company plans to use AWS-managed container services to reduce the overhead in managing the servers. The application should allow employees to access company documents, which are accessed frequently for the first 3 months and then rarely after that. As part of the company policy, these documents must be retained for at least five years. Because this is an internal web application, the company wants to have the lowest possible cost.
Which of the following implementations is the most cost-effective solution?
A)Deploy the Docker containers using Amazon Elastic Kubernetes Service (EKS)with auto-scaling enabled. Use Amazon EC2 Spot instances for the EKS cluster to further reduce costs. Use On-Demand instances for the Amazon RDS database and its read replicas. Create an encrypted Amazon S3 bucket to store the company documents. Create a bucket lifecycle policy that will move the documents to Amazon S3 Glacier after three months and will delete objects older than five years.
B)Deploy the Docker containers using Amazon Elastic Container Service (ECS) with Amazon EC2 On-Demand instances. Use On-Demand instances as well for the Amazon RDS database and its read replicas. Create an Amazon EFS volume that is mounted on the EC2 instances to store the company documents. Create a cron job that will copy the documents to Amazon S3 Glacier after three months and then create a bucket lifecycle policy that will delete objects older than five years.
C)Deploy the Docker containers using Amazon Elastic Container Service (ECS) with Amazon EC2 Spot Instances. Use Spot instances for the Amazon RDS database and its read replicas. Create an encrypted ECS volume on the EC2 hosts that is shared with the containers to store the company documents. Set up a cron job that will delete the files after five years.
D)Deploy the Docker containers using Amazon Elastic Container Service (ECS) with Amazon EC2 Spot Instances. Ensure that Spot Instance draining is enabled on the ECS agent config. Use Reserved instance for the Amazon RDS database and its read replicas. Create an encrypted Amazon S3 bucket to store the company documents. Create a bucket lifecycle policy that will move the documents to Amazon S3 Glacier after three months and will delete objects older than five years.
정답 : D
풀이 및 공부
보기
- EKS를 쓸 것이냐? ECS를 쓸 것이냐?
- ECS는 On-Demand Instances 쓸 것이냐? Spot Instances를 쓸 것이냐?
- RDS는 On-demand? Spot? RI?
A번
Deploy the Docker containers using Amazon Elastic Kubernetes Service (EKS)with auto-scaling enabled
라는 지문이 나오는데, EKS보다는 ECS가 기본적으로 싸다는 생각이 있었는데 그 이유는 cluster 생성한 것 자체만으로 EKS는 비용을 받기 때문이다.
ECS, EKS에서 어플리케이션을 run 하려면 cluster를 가장 먼저 만들어야한다. EKS는 ECS와 다르게 cluster 비용을 받는다. (그래서 개인 프로젝트를 하거나, 규모가 작을경우 ECS가 나은 것 같다.)
EKS pricing model includes the same conditions as ECS, but there are additional costs. Users pay $0.10/hour for each Amazon EKS cluster
아마 사용자가 control plane을 직접 관리하지 않아도 되고, 이 부분을 AWS가 대신해줌으로써 내부적으로 약간의 리소스가 필요한데 이것에 대한 비용을 받는 것 같다.
ECS vs EKS
정말 간단히 요약하면 ECS가 조금 더 추상화되어있는 서비스라고 생각하면 된다.
ECS는 조금 더 쉬우며, 덜 복잡하다.
EKS는 조금 더 어려우며, 더 복잡하다.
반대로
ECS는 유연성이 떨어지며, detail한 setting은 어려울 수 있다.
EKS는 유연하며, 더 복잡한 setting도 제어할 수 있다.
B번
ECS On-demand에서 탈락. 가장 비용효율적이어야 하므로 Spot 을 써야함
C번
Set up a cron job that will delete the files after five years.
cron job을 Set up 할 필요없다. S3 Lifecycle만 설정하면 됨.
Use Spot instances for the Amazon RDS database
이게 좀 헷갈렸는데 RDS도 Spot instance를 지원하는가? –> 지원하지 않는 듯
D번
참고
https://www.missioncloud.com/blog/amazon-ecs-vs-eks-which-service-is-right-for-you
https://tlakomy.com/managing-s3-lifecycle-policies-with-cdk
Comments