0

I am planning to move a web application to AWS for the first time. It contains (locally):

  • A web server running on port 80 (Apache2)
  • A websockets server running on port 8080 (Ratchet)
  • A server for search : EleasticSearch 2.3 on port 9000
  • A database server: MySQL 5.7

Assuming that my application will need more resources over time, I have two things in mind:

1 - Launch new instance with the AMI containing all the software. In this case, resources of the instance are shared between all softwares.

2- Create 'group's and use multiple AMIs, each AMI contain one software. In this scenario, launching a new instance in a group will add resources to only one software.

What is the most used and convenient approach? Does the second approach need more tools/software to implement?

Thank you very much for your usual help.

Adib Aroui
  • 4,981
  • 5
  • 42
  • 94
  • Not sure what you're pricing is but if you wanted to go through full aws services your load balancer would become an application aws load balancer (the application part is important for websockets), and your db server could move to RDS. Then you'd create an two instances for your web server and elasticsearch. I suggest using the AWS AMI's, their support for documentation/upgrade paths are generally better and its easier to receive automatic updates where applicable. If you ever containerize and move to ECS you have more responsibility running ubuntu as your host then the amazon provided ami's – Datise Apr 06 '18 at 17:28
  • @Datise thank you sir for your informative comment. – Adib Aroui Apr 09 '18 at 19:15

1 Answers1

1

You need to decide what parts of your stack are public and what are internal only. You probably don't want to expose your ES cluster or database to the public.

Then decide the appropriate technology for each part of the stack.

For the database, RDS is a no-brainer.

For search, decide if you want to manage the cluster yourself or if the AWS Managed Elasticsearch will do.

For the web and websockets, both supported by the Application Load Balancer. I would have separate target groups, with separate autoscaling groups for each. One additional reason for using a load balancer, vs just a single instance, is to be able to take advantage of the AWS Certificate Manager to provision and deploy a cert to enable TLS for your site.

Then you just need to decide if you want to use path-based routing or host-based routing for your front end.

So each tier would have it's own AMI (if that's how you're doing deployments) and can be monitored and scaled independently.

chris
  • 36,094
  • 53
  • 157
  • 237
  • First, I thank you for your informative answer. It contains a lot of concepts and keywords which are helping me decide what architecture/solutions to use, now and in the future. After some few research, I decided to completely remove the realtime-part of the project till it becomes more mature. So no load balancing right now. I will use one instance of ES, on instance for application (PHP, Apache), and one RDS instance. Thank you a lot. – Adib Aroui Apr 09 '18 at 17:10
  • 1
    I updated the answer with one additional bit of information - you really want to make sure your site is secure, and using ACM with ALB is very easy to do. You can still have a single instance behind it if you don't want to implement autoscaling at this point, but if you're generating AMIs then it's pretty simple. – chris Apr 09 '18 at 22:47