Sr. Software engineer at Neurosensum International India Private Limited·

We have an Angular app for our B2B app and I'm unable to understand what to choose and why? currently, we use the Azure Web app. What can be the possible issues with each Stack?

I want to make sure that we have high availability with minimum infrastructure requirements such as load balancers and web servers. But with maximum performance metrics. 1) EC2 will give full control to me but I will have to manage everything on my own. 2) EBS is a more or less managed system but will we lack any less control? 3) S3 is it scalable and can it handle large requests that will need load balancers and what about performance metrics.

READ LESS
2 upvotes·16.9K views
Replies (2)
Principal Software Engineer at Tophatter·

Hi Vibhanshu, When it comes to serving a static website, single page application, S3 or a combination of S3/CloudFront, is a great fit. There is no server that you need to manage, and S3 is as resilient and scalable at it gets. Moreover, it's certainly the most cost-effective solution you'll be able to come up with. Is your application fully static or does it come with compute needs? - Regardless, I would highly discourage you from running anything directly on a custom EC2 instance of your own, as this will from the get-go but also over time, come with high maintenance costs. - Elastic Beanstalk, (not to be mistaken with EBS, which acronym stands for Elastic Block Storage), on the contrary, is a rather powerful way to manage your applications and environments. Either via the CLI or through the console, you can easily configure your environment variables, load balancers, certificates, events/thresholds causing your instances counts to scale up/down, steaming of logs... - Elastic Beanstalk supports by default a couple of language, but these don't always allow you to run the version/dependency you need. For best decoupling from the underlying instances, you might want to look at leveraging Docker (Elastic Beanstalk has Docker-compatible AMIs), so you are in control of the stack you application runs on.

READ MORE
5 upvotes·3 comments·16.9K views
Kaibo Hao
Kaibo Hao
·
January 29th 2020 at 12:05AM

@Julien 's reply clearly explains the options to your requirement. While I would like to recommend Elastic Container Service(ECS) on AWS which provides more flexibility than EBS and less management on EC2 nodes. Please take advantage of Fargate which is a mini managed virtualization service in ECS two options (The other is EC2 instance) for the container host. The Fargate provides the container service with efficient cost.

·
Reply
Vibhanshu Biswas
Vibhanshu Biswas
·
February 10th 2020 at 7:36AM

I have mixed up EKS and fargate now. need to revisit the two technologies later on. or you might provide a better understanding. right now I have started the elastic beanstalk with docker.

·
Reply
Vibhanshu Biswas
Vibhanshu Biswas
·
February 10th 2020 at 7:34AM

I have started with Elastic beanstalk with Docker and it has made my task a bit easier. I will share more update as and when I proceed. Currently I need to decide what to do with my existing mongo db. we were managing this server on our own. I'm thinking of moving to a managed instance, again depends on the cost. the services I have in my mind is Atlas or the documentDB. I'm still assessing these two.

·
Reply
Recommends
on
Amazon S3

As you have only mentioned an Angular app so I'm assuming that you're hosting your backend APIs separately. You can do a production build of the Angular app and put it in S3 (without public access). Next, you can create a CloudFront distribution for this bucket and point a record in your Route53 hosted domain to this distribution. This way your website will be highly available and fast as caching will be available. Note: With this method, you should make sure when you push new build in the bucket, you do not delete the service-worker script or else service worker will stop caching.

I will not recommend using EC2 as it seems overkill for this task. You will have to manage an AMI with Nginx or Apache or some other static web server on your own. You will also have to attach an elastic IP with the instance or an ALB for connecting it to a Cloudfront distribution. Too much work.

You can go with Elastic Beanstalk. It will reduce the setup work but still big resources for an Angular SPA.

As a bonus, you can have multiple Cloudfront distribution+S3 bucket for multiple environments (production, staging, etc.) and use weighted routing in Route 53 record for AB test or blue/green deployments.

READ MORE
3 upvotes·16.6K views
Avatar of Vibhanshu Biswas

Vibhanshu Biswas

Sr. Software engineer at Neurosensum International India Private Limited