AWS Best Practices – Architecting for Cloud –
The whitepaper Architecting for Cloud – AWS Best Practices provides architectural patterns and advice about how to design systems that are reliable, secure, high-performing, and cost-efficient.
AWS Design Principles
Scalability
AWS offers virtually unlimited on-demand capacity. However, architecture should be designed to take full advantage of these resources
Two ways to scale an IT infrastructure are available. Upgrading EC2 instances with more RAM, CPU, IOPS or networking capabilities
You will eventually reach a limit and it is not always cost-effective or readily available.
Horizontal scaling is achieved by increasing the number of resources, e.g. Adding more EC2 instances and EBS volumes
Cloud computing can be used to increase the flexibility of your business
Not all architectures can be designed to distribute the workload to multiple resources.
Applications designed to be stateless should not store any session information or previous interactions.
After running tasks have been completed, capacity can be increased or decreased.
If necessary, state can be implemented usingLow latency storage, for e.g. DynamoDB and Redis are used to maintain state information
Session affinity, for e.g. ELB sticky sessions are used to bind all transactions to a specific compute resource. It cannot guarantee sessions that are already running on new resources, nor can it take advantage of them.
Push model allows load to be distributed across multiple resources. ELB distributes load across multiple EC2 instances
Pull model, for example. Through SQS and Kinesis, where multiple consumers subscribe to and consume
Distributed processing, such as. EMR and Kinesis are two examples of distributed processing. They help to process large amounts of data by breaking down task and its data into smaller pieces of work.
Before resources can be considered permanent, they must be considered temporary resources and not fixed on-premises resources.
AWS focuses on the concept of Immutable infrastructureservers once launched, is never updated throughout its lifetime.
Updates can be done on a new server with the most recent configurations.
This ensures that resources are always in a consistent and tested state. It also makes it easier to roll back.
AWS provides multiple ways to instantiate compute resources in an automated and repeatable wayBootstrapingscripts to configure and setup for e.g. Cloud-init and data scripts to install software and copy resources and code
Golden ImagesA snapshot of a specific state of the resource
Faster start times and removal of dependencies on configuration services or third party repositories
ContainersAWS support through Elastic Beanstalk or ECS for docker images
Docker allows you to package a piece software in a Docker image. This is a standard unit for software development and contains everything the software needs: code, runtimes, system tools, system library, etc.
CodeAWS infrastructure assets can be programmable. Software development techniques, practices and tools can be used to make the entire infrastructure reusable, maintainable and extensible.
AWS provides services like CloudFormation, OpsWorks for deploymentAutomation
AWS offers many automation tools and services that help improve the system’s stability, efficiency, and time to market. Elastic Beanstalka PaaS allows for quick application deployment and manages resource provisioning, load balancencing, auto scaling and monitoring.
CloudWatch alarm with EC2 Auto Recovery creates an EC2 instance that is monitored and automatically recovers if it becomes damaged.
The recovered instance is identical to its original instance, including the instance ID and private & elastic IP addresses. It also contains all metadata.
The instance is migrated via reboot