ECS VS EC2 which is better for hosting static website.

0

Hello guys, need to know which service is better for hosting a static website, an ECS (fargate), or EC2 Reserved Instances. Thanks.

3개 답변
2

Static websites do not require server-side processing. And S3 static website hosting is a mean that can achieve the objective without building a server, which seems appropriate.

Hosting a static website using Amazon S3 - Amazon Simple Storage Service

Is there any reason why you should use ECS or EC2? It will be easier to get an appropriate answer if you share it.

As for the comparison between ECS (Fargate) and EC2 Reserved Instances, EC2 has a simple configuration, but on the other hand, it requires server operations. In contrast, ECS has the opposite: the complexity of the configuration is a disadvantage, but you can expect a reduction in server operation toil due to the containers. However, there are many other factors to consider, and which one you should adopt depends on your requirements.

profile picture
답변함 일 년 전
  • Thanks for answering. I have stated ECS and EC2 because of the adequate use of read-write from the database and for scalability in future

  • Do you plan to use databases? Static sites cannot access databases because they cannot process on the server side. If you need databases, you must configure it as a dynamic site, so S3 static website hosting cannot realize the purpose, so forget my suggestion.

1
수락된 답변

You can use these both options if you plan to use database, etc. The main difference between the two services are:

  • ECS stands for Elastic Container Service, which means you need to use a container to deliver your site. This means create a Dockerfile and everything that comes away. With Fargate, is a "serverless" way to run ECS since you just adjust how much capacity you want. Use for less admin overhead, containers.
  • EC2 stands for Elastic Cloud Computing, so basically you are 'serverfull''. You will have to admin everything. Patch the OS, and decide if you want or not use use containers and if so, install the software etc. The option of RI (Reserved Instance) is good for when you have a steady and very predictable resource usage, since you can reserver the instance(s) up to 3 years with a discount. Use for full server admin and very predictable usage in the long-term.

Since this post also has the serverless tag, you can use Amplify Hosting if your site is using a framework supported, comes with server side rendering, access to API, databases, etc,

profile pictureAWS
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
1

I share my case.

I used ECS as the frontend and backend servers were divided.

After that, it was more convenient to manage with Docker rather than access and use EC2.

Because it uses Docker, it was easy to used on localhost and the stage and develop servers.

And it was better to do deployment and rollback while using code deploy.

Seobs
답변함 일 년 전
  • Thanks for your answer. I will apply the same.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠