-1

,Hi everybody. At the moment I am looking for a good way to host my MERN Stack application and found that Cloud Hosting via AWS would be a great solution. Before proceeding I wanted to clarify some questions of understanding how Cloud Hosting works.

What I have understood is that Cloud Hosting is based on instances that are running somewhere in the AWS System. In the case that I wanted to increase the performance of my hosted app I could add another instance so that there would be two instances running for my app.

  • When users open my website, how is the traffic split between my two instances? Normally my domain would link to the IP address of one instance, but wouldn't the other instance be unreachable then?

  • My database would be running on each instance separately, right? How could I make one database used by all other instances?

Thanks in advance! I appreciate any help

zunkelty
  • 23
  • 3
  • How to articles exist on load balancing, high availability databases, and scaling to many instances. Please do some research, decide for yourself what your infrastructure looks like, and come back with a specific question. If you want to make running the instances someone else's problem, use a managed platform as a service, AWS has many of those. – John Mahowald Jul 04 '20 at 17:08

1 Answers1

0

Based on your questions I don't think you should be setting up anything AWS. AWS and other cloud services are enterprise grade systems that are very powerful, but they're also very complex. AWS professionals have typically studied AWS for hundreds of hours and worked in the area for years to get good at it. If you put things up in AWS, Azure, Google you're going to have problems getting it going, scaling it, and securing it.

I suggest you use a service provider, or at least hire someone to do it for you, otherwise you will find you have problems now or in the future.

To answer your questions though:

  • Your software runs on EC2 instances (virtual machines). You specify how many, the size, and where they run. The easiest option is to get a larger machine, but the better option is to use a load balancer and scale out, which means if the system isn't busy instances are removed and you don't pay for them.
  • A load balancer like the ALB splits traffic between instances. I think it's done on "least connections" but there's some flexibility there, I think you can load balance based on response times. I haven't looked at the details of this in a while.
  • You can use AWS Relational Database Service, you can have a host dedicated to running the database, or one VM can run a database and the other instances can connect to it. RDS is the best option in many cases.
Tim
  • 31,888
  • 7
  • 52
  • 78