Low cost scalable Laravel on AWS

Low cost scalable Laravel on AWS

https://ift.tt/2vqTXyl

Lets get technical.

First step is to create a AWS account and Bitbucket account if you haven’t already!

There are going to be 2 environments, 1 for the web requests and 1 for queue jobs, so that we do not process long running queue jobs in the same place and have our server reject/delay requests because of resources are being used:

Beanstalk web application

  • Create new Beanstalk application
  • Create new environment, choose Web server environment
  • Choose PHP Platform
  • Choose Sample application (for now)
  • Click on the button Configure more options (bottom right)
  • Choose High availability (using Spot and On-Demand instances)
  • Click Modify under the Software section, and check the box to Enable Log Streaming. This step will stream the access and error logs in CloudWatch which you can later group and query them, so that our life is easier when our application is in production.

This is all for a sample application, click create environment

Beanstalk worker application

  • Create new Beanstalk application
  • Create new environment, choose Worker environment
  • Choose PHP Platform
  • Choose Sample application (for now)
  • Click on the button Configure more options (bottom right)
  • Choose High availability (using Spot and On-Demand instances)
  • Click Modify under the Software section, and check the box to Enable Log Streaming. This step will stream the access and error logs in CloudWatch which you can later group and query them, so that our life is easier when our application is in production.

This is all for a sample application worker, click create environment

RDS for database

I would recommend that you never manage the database on your own! it will give you a lot of headaches (depending on the size of the team).
So just go and create an RDS instance which is managed by AWS and you do not have to worry about availability, best practices, configurations, backups, monitoring etc.

Follow the official documentation from AWS: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateDBInstance.html

programming

via Laravel News Links https://ift.tt/2dvygAJ

March 16, 2020 at 08:51AM