The solutions we provided for the client allowed them to host a highly available and scalable WordPress site with minimal intervention. Using ECS Fargate, we could handle demand better by scaling out with Serverless Fargate Containers in a fraction of the time it would usually take to spin up an instance. This allowed us to make the site self-healing by using an autoscaling group. Finally, by using Fargate containers with an ALB and ASG, we could make this application highly available by creating containers in different availability zones.
Having multiple containers spread across multiple availability zones helped to make the site more resilient, but it also presented a challenge. WordPress stores essential data and resources on the instance/container it runs on, meaning that there could be differences between the multiple containers. We solved this issue using AWS EFS, which allowed all containers to share a standard directory and store all files in the same network location. By using EFS, we could ensure that the WordPress containers would stay in sync with each other.
A key component of the solution was the use of AWS CloudFormation utilizing nested stacks. The client expressed interest in managing this solution utilizing existing CI/CD systems. In order to help the client easily manage the solution and incorporate it into their CI/CD pipelines, we used nested stacks to allow for modular use of the CloudFormation components. For example, a nested stack was created to be responsible for the creation and management of the underlying VPC. By providing modular CloudFormation components, this would allow the client to use these scripts for more than one environment of the created solution, but also leverage them for new products.