Architecting for the AWS Cloud – Best Practices

  1. Scaling up (vertical scaling where you upgrade the memory/CPU) vs scaling out (horizontal scaling where you add additional instances of same size/type)
  2. Design distributed stateless components that can be disposed or added based on demand
  3. You can create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and automatically recovers the instance if it becomes impaired due to an underlying hardware failure or a problem that requires AWS involvement to repair. Terminated instances cannot be recovered. A recovered instance is identical to the original instance, including the instance ID, private IP addresses, Elastic IP addresses, and all instance metadata.
  4. Infrastructure as code
    1. Cloud Formation scripts can be used to automate creation/provision your AWS resources in orderly and predictable fashion and repeat the formation as many times as needed
  5. Use Auto Scaling to scale out and back
  6. Use cloud watch alarms/events to send SNS notifications when a particular metric goes beyond a specified threshold level. SNS can trigger a lambda or en-queue SQS message or POST to API endpoint
  7. Lambda Schedules Events: They can be scheduled and run a lambda function at a specified time at regular intervals
  8. Loose Coupling
    1. Ensures a failure in one component does not cascade it to other component
  9. Service Discovery
    1. Instead of hard coding ip address of a loosely coupled service, we should use DNS/Rout 53 zones/ELB end points
  10. Asynchronous Integration
    1. Suitable for interaction between two components of a system where immediate response is not needed. Only an acknowledgement that the request was received will suffice. Example SQS or Kinesis
    2. Loosely coupled components make the system resilient and enables graceful failure
    3. Tight Coupling vs Loose Coupling AWS components
  11. Services NOT Servers
    1. Use Lambda/S3/DynamoDb as opposed to EC2
    2. Serverless architecture can scale out easily
    3. Use Cognito as identity store as opposed to custom solutions that live on EC2 or SQL database
    4. RDS can be used to scale horizontally thru read replicas as opposed to vertical scaling by upgrading instance type with higher memory/CPU
    5. RDS multi AZ deployment feature can be used to automatically replicate your db in a different AZ and fail-over in real time when disaster strikes (DR Disaster Recovery)
    6. Anti Patterns: If you application can maintain data integrity and there is no need for major JOINs or normalization, use DynamoDB NoSQL database which is inherently scalable horizontally for both reads and writes
  12. Remove single point of failure and use redundant systems
    1. Active or Standby redundancy
  13. Failure Detection
    1. Alarms/Health Checks
  14. Cost Reduction
    1. Right Sizing: Find the minimum configuration that is suitable. Use magnetic as opposed to SSD use small as opposed to large EC2 etc
    2. Use spot instances
    3. Use auto scaling to scale back (right sizing)
  15. Security
    1. Use ACLs/Security Groups
    2. Use IAM roles as opposed to access key id/secret access key
    3. Use application firewalls
  16. Use Cloud Watch to enable real time logging/monitoring/auditing resources
<<< AWS Well-Architected framework (February 2018 CSAA Exam)AWS CSAA – Released February 2018 Exam Questions >>>
Copyright 2005-2016 KnowledgeHills. Privacy Policy. Contact .