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

  1. Use multiple availability zones for both the instances and databases.
  2. Use a fault tolerant RDS Mysql database instances
  3. Define autoscaling groups and LaunchConfigs to create the scaled tier
  4. Base the web app on plain Drupal
  5. Use an Elastic Load Balancer to distribute read-only web traffic across instances.
  6. Use an isolated instance and autoscaling group to provide write access to the site.
  7. Use Route53 and CNAMEs to given the read-only and writable endpoint useful hostnames.

Deployment features

  1. The entire system must be able to be deployed automatically with a single command.
  2. Static data should be kept in an S3 bucket or locally and deployed remotely on demand.
  3. Configuration details of the resource URL and credentials should be dynamically injected into instances following 12 Factor standards.
  4. Separate build, release, and run stages where possible.
  5. Use cloud-init to bootstrap build and environment injection into instances
  6. 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

  1. All code and artifacts should be put into a single GitHub repository, unless pulling in code from external sources.
  2. Document your code layout and build process
  3. Document how to deploy, update, and destroy the running service using CloudFormation or similar orchestration.
  4. Document settings and tuning needed to ensure graceful failover.
  5. Ensure that sensitive data and configs are kept separate from code and artifacts, in keeping with 12 Factor standards.

Demonstration of Resiliency

  1. 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.