Deploying a Fault Tolerant LAMP based Service - huit/cloud-boot-camp GitHub Wiki
Description
This exercise models a LAMP based website for which most of the traffic is read-only. By exploiting the lack of shared session between requests, the read-only view of the site can be scaled horizontally
Features of Solution
The solution will automatically deploy a horizontally scaled website in AWS, implementing the above architecture.
Architectural features
- Use multiple availability zones for both the instances and databases.
- Use a fault tolerant RDS Mysql database instances
- Define autoscaling groups and LaunchConfigs to create the scaled tier
- Base the web app on plain Drupal
- Use an Elastic Load Balancer to distribute read-only web traffic across instances.
- Use an isolated instance and autoscaling group to provide write access to the site.
- Use Route53 and CNAMEs to given the read-only and writable endpoint useful hostnames.
Deployment features
- The entire system must be able to be deployed automatically with a single command.
- Static data should be kept in an S3 bucket or locally and deployed remotely on demand.
- Configuration details of the resource URL and credentials should be dynamically injected into instances following 12 Factor standards.
- Separate build, release, and run stages where possible.
- Use
cloud-init
to bootstrap build and environment injection into instances - Encapsulate the instance build process as either
- a startup phase of the instance, or
- as a AMI build process that builds a disk image ahead of time.
Documentation
- All code and artifacts should be put into a single GitHub repository, unless pulling in code from external sources.
- Document your code layout and build process
- Document how to deploy, update, and destroy the running service using CloudFormation or similar orchestration.
- Document settings and tuning needed to ensure graceful failover.
- Ensure that sensitive data and configs are kept separate from code and artifacts, in keeping with 12 Factor standards.
Demonstration of Resiliency
- Demonstrate that the site remains up and responsive to the following failures:
- Failure of the master RDS instance
- Failure of an individual instance
- Failure of ALL object in a given availability zone.