Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying SPA(angular2) on S3 vs EC2

I have angular application with nodejs backend(REST API). I am confused with S3 and EC2. which one is better and what are the pros and cons deploying to each.Considering average load. Help will be highly appreciate.

like image 946
Abhishek Singh Avatar asked Sep 02 '25 02:09

Abhishek Singh


1 Answers

I figured it out by myself.

S3 is used to store static assets like videos, photos, text file and any other format file. It is highly scalable, reliable, fast, inexpensive data storage infrastructure.

EC2 is a like your own server. And it is on Cloud so computing capacity can be decreased or increased instantly as per server need.

So here my confusion is clear as ...

When we build Angular2 Application it generates .js files which called bundle in term of angular2. Now, these files can be hosted on S3 Bucket. And can be accessed through CloudFront in front of it. Which is very fast cache enabled. And pricing model is pay per request.

But EC2 is like running own server. And we have to configure server it self so for angular application it is not good. It is good for node Applicationas it can do computation.

like image 127
Abhishek Singh Avatar answered Sep 05 '25 15:09

Abhishek Singh