AWS - Best Practice Flashcards
1, Difference of Cloud architecture 2, Design Principles;
1
Q
The Cloud Computing Difference
A
- IT Assets Become Programmable Resources;
- Global, Available, and Unlimited Capacity
- High Level Management Services
- Security Built In
2
Q
Design Principles
A
- Scalability;
- Disposable Resources instead of Fixed Servers;
- Automation;
- Loose Coupling;
- Serverless;
- Databases;
- Removing Single Point of Failure;
- Optimize Cost;
- Caching;
- Security;
3
Q
Scalability
A
Support growth in users, traffic, data without performance sacrifice:
- Scale Vertically : Increase in a specification of a certain type of resources; e.g. Change to a high tier EC2 Instances
- Scale Horizontally : Increase in number of resources; e.g. Increase the number of EC2 Instances.
4
Q
Scale Horizontally - Scenarios
A
- Stateless Application : Push (SNS) or Pull(SQS, Knesis) mode;
- Stateless Components : decoupling;
- Stateful Components : session affinity using Load Balancer, DNS or Client designed to choose a healthy server endpoint using API to inform the client about the health information from server.
- Distributed Processing : Large amount of data that requiring huge computation capability
5
Q
Disposable Resources Instead of Fixed Servers
A
- immutable infrastructure pattern;
- Instantiating Compute Resources;
- Bootstrapping: AWS OpsWorks supporting Chef recipes or Bash/PowerShell.
- AWS APIs;AWS CloudFormation;AWS Lambd
- Golden Images; AMIs;VM Import/Export
- Docker : Amazon ECS; AWS Elastic Beanstalk
- Infrastructure as code : CloudFormation
6
Q
Automation : Improves system stability and organisational efficiency. Related service are:
A
- AWS Elastic Beanstalk: deploy environment according to code uploaded;
- AWS EC2 Auto Recovery: Identical Instance except in-memory data.
- Autoscaling : scale resources up and down to fit actual business demand. Improving availability and cost efficiency.
- AWS CloudWatch Events: can stream to targets : Lambda, SNS, Kinesis Streams;
- AWS OpsWorks Lifecycle events: trigger Chef recipes to activate new configuration.
- AWS Lambda Scheduled events : schedule a regular Lambda function execution.
7
Q
Loose Coupling : break down system complexity and reduce interdependence to prevent failure cascading
A
- Well-Defined Interfaces: RESTful APIs : e.g. Amazon API Gateway
- Service Discovery: service registration and discovery method/ELB
- Asynchronous Integration:
- NOT requires immediate response and only ACK of recieving;
- Buffering front-end spikes with low cost and customer experience;
- SQS->Kinesis:time-series->SWF->Lambda
- Graceful Failure: cahced content/backup site (static or dynamic)
8
Q
Services, Not Servers
A
- Managed Services
- S3, CloudFront,ELB,DynamoDB,CloudSearch,Elastic Transcoder
- SES,SQS,SNS
- Serverless Architectures
- AWS Serverless Multi-Tier Architectures” whitepaper
9
Q
Databases-Questionaire to make choices
A
- Access Type : Is this a read-heavy, write-heavy, or balanced workload? How many reads and writes per second are you going to need? How will those values change if the number of users increases?
- Data Size: How much data will you need to store and for how long? How quickly do you foresee this will grow? Is there an upper limit in the foreseeable future? What is the size of each object (average, min, max)? How are these objects going to be accessed?
- Duriability : What are the requirements in terms of durability of data? Is this data store going to be your “source of truth”?
- Latency : What are your latency requirements? How many concurrent users do you need to support?
- What is your data model and how are you going to query the data? Are your queries relational in nature (e.g., JOINs between multiple tables)? Could you denormalize your schema to create flatter data structures that are easier to scale?
- What kind of functionality do you require? Do you need strong integrity controls or are you looking for more flexibility (e.g., schema-less data stores)? Do you require sophisticated reporting or search capabilities? Are your developers more familiar with relational databases than NoSQL?
10
Q
RDS (RDBS, SQL)
A
- Scalability:
- Vertically;
- Horizontally : Read Replicas - Tolerance of Slightly Stale data.
- Write ability scale : data partitioning or sharding
- High Availability:
- Multi-AZ: worm standby short period interuption needs Graceful Failure design for APP.
- Anti-Patterns: Consider NoSQL
- no need for joins or compex transactions;
- write throughput to multiple instances
- Large file (Audio, Video, Image) S3+Metadata in DB
11
Q
NoSQL Databases
A
- variety of data models : graphs, key-value pairs, and JSON documents;
- Scalability : scale both the reads and the writes in a horizontal fashion
- High Availability: synchronously replicates data across three facilities in an AWS region
- Anti-Patterns:
- cannot be denormalized and your application requires joins or complex transactions
- Whitepaper : Best Practices for Migrating from RDBMS to DynamoDB
12
Q
Data Warehouse
A
- Redshift : 1/10 Cost;easy to deploy and operate
- Scalability : massively parallel processing (MPP), columnar data storage, and targeted data compression encoding schemes; Allows horizontal scale by increase number of Nodes
- HA:
- recommend multi-node clusters deployment;
- data backup into S3
- Anti-Patterns:
- RDBMS - Redshift
- OLAP not OLTP (RDS or DynamoDB)
- Search :
- Amazon CloudSearch is a managed service that requires little configuration and will scale automatically
- Amazon Elastic Search offers an open source API and gives you more control over the configuration details. Also for analytics engine for use cases such as log analytics, real-time application monitoring
- High Availability Both services provide features that store data redundantly across Availability Zones
13
Q
Removing Single Points of Failure
A
- Introducing Redundancy:
- Standby Redundancy: Hot / Warm
- Active Redundancy: Load balancing;
- Detect Failure: Deep health check or simple one.
- Durable Data Storage:
- Replicas : Asynchronous, Synchronous, Quorum-based
- Versioning:
- RPO,RTO are trade-offs for this index.
- Automated Multi-Data Center Resilience
- Multi AZ Principle
- Fault Isolation and Traditional Horizontal Scaling
- Using Sharding and Shuffle Sharding to avoid failure cascading
14
Q
Optimize for Cost
A
- Right Sizing
- Benchmark and make right selection on instance types or Storage types for example.
- Continuous monitoring and tagging: AWS Elastic Beanstalk and AWS OpsWorks, AWS Config to assess.
- Elasticity : autoscaling or utilize managed services.
- Take Advantage of the Variety of Purchasing Options
- On demand : flexibility
- Reserved Instances: Using Trusted Advisor or EC2 usage report to identify the minimum capacity requirement. Also for services like Amazon Redshift, Amazon RDS, Amazon DynamoDB, and Amazon CloudFront.
- Spot Instances: Bid for AWS spare EC2 computing capacity; instance running if Spot market price is lower than your bid.
- Bidding strategy,
- Mix with On-Demand.
- Spot Blocks for Defined-Duration Workloads
-
Test APP on different instances and bid on all instance types to reduce cost
*
15
Q
Caching
A
- Application Data Caching : intensive database queries or outcome of computationally intensive processing. Memcached and Redis.
- Edge Caching: static content or dynamic content (html response or live video) benefits are as following:
- reusage of existing connections reduces connection setup latency.
- connections optimizations to avoid internet bottlenecks between edge location and the viewer.
- Both upload and download request will be benefited.