Which Amazon web service for Node Js server? [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am quite confused with Amazon Web Services, all that I want to do is to create a Node Js server on amazon and running it. Which service I should use ?
Here the list of services
Shoud I use CloudFront ? EC2 ? Elastic Beanstalk or or other ?
Any help would be really appreciated

I would not be so categoric as "use ec2" or "use something else" ...
well clearly on AWS if you want to deploy a node application, you have 2 main choices:
ec2 : https://codeforgeek.com/2015/05/setup-node-development-environment-amazon-ec2/
The Infrastructure as a Service (IaaS) offering from Amazon, you're free to do what you want/need and you manage your own servers.
elasticbeanstalk : http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.html
The Platform as a Service (PaaS) offering from Amazon, aws will provide you machines, sdk versions etc you will use to build your app and you manage only your app not the servers
each comes with their pros and cons. You can read this op about some of the differences.
Basically I will sum up like this:
If you're building a 'small' web app or want to concentrate purely on your app and do not use fancy 3rd party tool/libs go with ElasticBeanstalk, you develop your app you deploy your app and it works. aws will manage the servers, you can set up rules to scale automatically, you can connect to other aws services (mainly RDS for database, SNS for mail notification ...)
If you have access to IT resources who know how to setup and manage a server (including security ...) and need to develop an app with many additional services, lib that might not be supported by aws eb or other aws services (such as setting up a mongo db, there's no out of the box offering from rds or other so you will need to install on ec2 server or user another 3rd party services which provides this)
The topic is not to discuss all aws offering but just to complete on your question, cloud front is the CDN system of AWS so if you use a lot of static assets (JS, css, images ...) you should look into it, wether you use S3, eb or ec2 to deploy your app you will be able to use this service. It speeds up the delivery of static assets to your users by caching them on edge location closed to those users.

For Node js EC2 service should be used.
You have to install a software named putty configure it and run your node js script like you run on your localhost.
Here are some links to tutorials:
https://www.youtube.com/watch?v=WxhFq64FQzA
https://aws.amazon.com/developers/getting-started/nodejs/
To deploy files you can simply use FTP instructions given below:
Connect to Amazon EC2 file directory using Filezilla and SFTP

Related

How to do Production deployment of React + Nodejs? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 months ago.
Improve this question
I am trying to understand how to deploy the web application with docker and do a production level deployment.
I made a web application with react as front end and Nodejs as backend. I used Mangodb for database.
I used proxy to connect both front and back-end , so that they started communicating with each other.
The web application working good as I built and API and routed through front-end.
My Goal:
To deploy using Devops and CI/CD pipelines.
With my research , the best possible options are :
using docker
using circle ci with docker
But I still havent found a way on how to deploy the entire web application .
should I deploy the front-end and back-end using docker and setup github actions? Is this the right way to deploy the applications and if so how does the front-end and back-end can talk with each other?
options: deploy both front-end and back-end with docker and figure out a way on how they communicate with each other.
My last experience was deploying backend on heroku and use that link as proxy in the front-end where I deploy it via netlify.
option 2: use circle-ci and docker combined to deploy both front-end and back-end.
Can anyone suggest the best way to approach this situation ? and best resource to lookup where I can deploy the entire web application using devops tools .
Thanks
I thought of sharing my experience. This could be slightly helpful to your issue.
Are you using any aws services ?
For our projects, we're using aws. To deploy frontend applications, we're hosting them in S3 buckets and use cloudfront as edge locations to serve the requests. For backend, ECS cluster based on EC2 launch type is used. For backend deployment, docker is necessary to containerize each application image and create tasks in ecs cluster.
To use CI/CD, I'm using github, github web hook, codebuild and codepipeline. If any commit is made through a pull request, such changes are identified via web hook and then codebuild and codepipeline runs to build and deploy the changes to relevant environments.

AWS vs Firebase [Content Delivery Network]

Let's say I have a single page application using React/Node, and I want to deploy that application using a content delivery network to improve load performance.
To do that in Amazon Web Services (AWS) I would need to incorporate different services to work together.
I would need to host my bundled static web page files on amazon's S3 bucket. Then I would need to host my Node API on Elastic Beanstalk. Lastly, I would then need to setup a CloudFront distribution and set my origin to my S3 bucket.
It would look something like this:
Now, if I wanted to do the same thing in Firebase, according to this video tutorial, I can simply setup Firebase Hosting which is backed by their own CDN which gives similar improved load times. Firebase hosting can encompass the entire React/Node application without the need for separation or various services like I did in AWS.
My questions are:
How does Firebase hosting encompass dynamic Node Apps with out the need to separate the front and backend or use various other services?
The point of a CDN is to cache files, so it wouldn't be possible to use a CDN on a Node API right or wrong? If right then how is Firebase using Node app in their CDN?
It seems much simpler to setup on Firebase to serve an entire dynamic app on their CDN compared to AWS, would their be any drawbacks to this or is it just a better service?
Firebase Hosting is only for your static frontend code. But there is a way to connect Firebase Hosting and Cloud Functions to serve dynamic content that is pretty easy to setup.
https://firebase.google.com/docs/hosting/functions
You can think of Firebase Hosting a zero-ish config equivalent to the AWS S3/CloudFront section of the diagram.

How does one deploy multiple micro-services in Node on a single AWS EC2 instance?

We are pretty new to AWS and looking to deploy multiple services into one EC2 instance.
Each micro-service is developed in its own repository.
Each service will have its own endpoint URL
Services may talk to each other
Services can be updated/deployed separately
Do we need a beanstalk for each? I hope not.
Thank you in advance
So the way we tackled a similar issue at our workplace was to leverage the multi-container docker platform supported by Elastic Beanstalk in most AWS regions.
The way this works in brief is, we had dedicated repositories for each of our services in ECR (Elastic Container Registry) where the different "versioned" images were deployed using a deploy script.
Once that is configured and set up, all you would need is deploy a Dockerrun.aws.json file which basically highlights all the apps you would want to deploy as part of the docker cluster into 1 EC2 instance (make sure it is big enough to handle multiple applications). This is the file where one would also highlight link between applications (so they can talk to one another), port configurations, logging drivers and groups (yea we used AWS CloudWatch for logging) and many other fields. This JSON is very similar to one's docker-compose.yml which is used to bring up your stack for local development and testing.
I would suggest checking out the sample example configuration that Amazon provides for more information. Also, I found the docker documentation to be pretty helpful in this regard.
Hope this helps!!
It is not clear if you have a particular tool in mind. If you are using any tool for deployment of a single micro-service, multiple should be the same.
How does one deploy multiple micro-services in Node on a single AWS
EC2 instance?
Each micro-service is developed in its own repository.
Services can be updated/deployed separately
This should be the same as deployment of a single micro-service. As long as they have different path and port that they are running on, it should be fine.
Each service will have its own endpoint URL
You can use nginx as a reverse proxy which can redirect your request from port 80 to the required port of your micro service.
Services may talk to each other
This again should not be an issue. You can either call them directly with the port number or via fully qualified name and come back via nginx.

How to deploy a website created using eclipse jee and tomcat in amazon website?

I have created a website using eclipse and tomcat. I want to deploy it in a real web hosting area so that clients can use it. How to do that using aws?!
Amazon Web Services have a number of different tools to deploy applications on their infrastructure. It really depends on the level of control you want and need. Your options are as follows:
Elastic Beanstalk - You can simply upload your code and AWS will handle the entire deployment from capacity provisioning, load balancing, auto-scaling to application health monitoring. You can read more about it here - https://aws.amazon.com/elasticbeanstalk
AWS OpsWorks - You can define the application’s architecture and the specification of each component. You can read more about it here -https://aws.amazon.com/opsworks
There are also other services such as CodeDeploy which could form part of your release cycle. From your question, it sounds like Elastic Beanstalk would be the most suitable. If you have little experience deploying web applications it might be better to look for a managed hosting platform. AWS expects you to have in-depth knowledge of architecting and developing web applications.

Choosing shared Linux AMI machine image for AWS

I know next to nothing about server management and just got started with Amazon Web Services.
I want to deploy a Linux server which runs Apache, MySQL, phpMyAdmin as well as email capabilities (account mgmt and webmail interface) and backup capabilities. I want to administer the server with a nice web user interface like cPanel, doing things like file management, email account management, access to phpMyAdmin.
Therefore I thought about deploying a shared Linux AMI, instead of building and configuring the server myself. I want to make my life easy, that is, deploying something pre-existing which is easy to manage (web user interface) since I haven't got time to learn all about server management right now.
I found this list of images. Which one of these would fit my requirements?
This is an inappropriate use case for EC2. As Amazons CTO Werner Vogels said a few months ago "an EC2 instance is not a server, it's a building block." EC2 is used to provide computing resources to an application that spans multiple, loosely-coupled services. It's not a drop in replacement for a standard VPS.
That's not to say that a lot of people aren't using EC2 instances as servers. However, these are often the same people who bitterly complain about excessive downtime on AWS without realizing that it's mostly their own fault. An application must be designed to be deployed in a cloud-based environment when it's built on an IaaS platform like AWS. If your application is not aware of autoscaling groups and other high-availability features then traditional dedicated hosting will be cheaper, less complex, and more durable than AWS.
I am aware of AMI's for webmin, but not for cPanel. Here is the link:
https://www.virtualmin.com/documentation/aws/virtualmin_gpl_ami
I would echo the comments made by #jamieb however in that this is really not a good use case for EC2. You are limited to a single elastic IP per instance, so you have no ability to do IP-based virtual hosts as you would with a typical VPS.

Resources