Magento 2 auto scaling - AWS , DigitalOcean, GCP

Amazon RDS for MySQL.

Amazon RDS deployments are preconfigured with a set of parameters and settings appropriate for the DB instance class you choose. Amazon RDS supports automatic software patching, database backups, backup storage for a user-defined retention period, and point-in-time recovery.

Amazon RDS supports three types of storage: Provisioned IOPS, General Purpose, and Magnetic. For higher performance, consider using SSD Provisioned IOPS. You can convert any type of storage on a running cluster.

You can also use an instance of the appropriate size, but at the same time responsibility increases - you need to keep track of updates, copy on time, and be prepared for a quick recovery. This solution is recommended for projects with small databases.

Manage the data remotely from a personal computer, using for example MySQL Workbench, as well as the phpMyAdmin installed either on the admin server or on a separate isolated server.

 

Amazon EFS - shared storage for media and static assets.

Amazon EFS is a file storage service with a simple interface that enables you to create and configure file systems quickly and easily. Multiple EC2 instances can access centralized storage at the same time.

To automatically mount an EFS file system:

  1. Create a new EC2 instance using the Launch Instance Wizard.
  2. Create a new EC2 instance using the AWS CLI or user data.
  3. /etc/fstab file - update with an entry for the EFS file system.

This is the perfect solution for Magento 2 auto scaling.

Amazon ElastiCache

Amazon ElastiCache is an in-memory cache that helps you deploy and operate data in the AWS Cloud. ElastiCache cluster using the Redis caching engine. ElastiCache reduces the operational overhead involved in deploying a distributed caching environment, and provides a way to improve application load times.

Just configure the connection to end-point once and all instances in auto scaling will automatically save session and cache data in a single ElastiCache.

 

Amazon EC2 Web Server Instances

Elastic Load Balancing is used to automatically distribute the website load across instances. In addition, all the instances are launched in an Auto Scaling group that dynamically manages the Amazon EC2 fleet. The deployment sets low and high CPU utilization thresholds to automatically scale the number of EC2 instances up or down depending on load. Default policy adds new instances when the CPU load exceeds 90% for 10 minutes, and removes instances when the CPU load drops below 70% for 10 minutes.

You can specify the maximum number of instances in the Auto Scaling group, and Auto Scaling ensures that your group never goes above this size. You can also specify the desired capacity, either when you create the group or at any time thereafter, and Auto Scaling will ensure that your group has the desired number of instances..

We recommend that you benchmark the cluster to make sure you achieve the level of performance you need before starting a production deployment.