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 Answers
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
answered a year ago
  • 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
Accepted Answer

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
answered a year ago
profile picture
EXPERT
reviewed 10 months ago
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
answered a year ago
  • Thanks for your answer. I will apply the same.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions