Architecting for the Cloud Flashcards
Design Principle –Scalability
Scalability –Vertically and Horizontally;
Vertically – increase in the specifications of an individual resources; easy to implement but not always cost efficient or highly available. has to stop instance.
Horizontally – increase in the number of resources. a great way to build internet-scale applications that leverage the elasticity of cloud computing.
Stateless Applications
an application that needs no knowledge of previous interactions and stores no session information.
How to distribute load to multiple nodes
push model: through use of load balancing solution like the ELB. another way would be to implement a DNS round robin(route 53), DNS responses return an IP address from a list of valid hosts in a round robin fashion. Caching DNS resolvers are outside the control of route 53, and might not always respect your settings.
Pull model: asynchronouse event-driven workloads do not require a load balancing solution. in this model, data or tasks are stored as messages in a queue(SQS) or as a streaming data solution like Amazon Kinesis. Multiple compute nodes can then pull and consume those messages, in a distributed fashion.
Stateless Components
storing a unique session identifier in a http coolie and store detailed user session server-side(like database)
store larger file in S3 or EFS to avoid introduction of statefull components. SWF to store execution history and make these workloads stateless.
Statefull COmponents
Database; Legacy application designed to run on a single server by relying on local compute resources.
session affinity. – bind all the transactions of a session to a specific compute resources. Can be achieved through the “sticky sessions” feature of ELB.
Distributed Processing
offline batch jobs can be horizontally scaled by using a distributed data processing engine like Apache Hadoop.
Amazon Elastic MapReduce service to run Hadoop workloads on top of a fleet of EC2 instances withour the operational complexity. For real-time processing of streaming data, Amazon Kinesis partitions data in multiple shards that can then be consumed by multiple EC2, or lambda resources.
Design Principle – Disposable Resources instead of Fixed Servers
Instantiating Compute Resources:Bootstrapping, golden images, docker, hybrid model(Elastic Beanstalk)
Infrastructure as Code: cloudformation
bootstrapping vs, golden image
Items that do not change often or that introduce external dependencies will be part of your golden image.
Items that change often or differ between your various environments can ne set up dynamically through bootstrapping.
Hybrid model
Elastic Beanstalk follows hybrid model. It provides preconfigured run time environments(each initiated from its own AMI) but allows you to run bootstrap actions(through configuration files called .ebextensions)) and configure environmental variables to parameterize the environment differences,
Infrastructure as Code
AWS CloudFormation templates give developers and systems administrators an easy way to create and manage a collection of related AWS resources, and provision and update them in an orderly and predictable fashion. You can describe the AWS resources, and any associated dependencies or run time parameters, required to run your application. Your CloudFormation templates can live with your application in your version control repository, allowing architectures to be reused and production environments to be reliably cloned for testing.
Design Principle – Automation
AWS Elastic Beanstalk; EC2 auto recovery; Auto scalling; cloudWatch Alarms; cloudwatch Events; OpsWorks Lifecycle events; Lambda Scheduled events;
Design Principle – Loose Coupling
Well-defined interfaces – Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. It handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management.
Service Discovery: through Elastic Load Balancing, or service registration and discovery method.
Asynchronous Integration: suitable for any interaction that does not need an immediate response and where an acknowledgement that a request has been registered will suffice.
Graceful Failure: The Amazon Route 53 DNS failover feature also gives you the ability to monitor your website and automatically route your visitors to a backup site if your primary site becomes unavailable. You can host your backup site as a static website on Amazon S3 or as a separate dynamic environment.
Design Principle – Services, Not Servers
Managed Services and Serverless Architectures(Lambda and Amazon Cognito for mobile apps.
How to take advantage of read replicas?
Read replicas are separate database instances that are replicated asynchronously. As a result, they are subject to replication lag and might be missing some of the latest transactions. Application designers need to consider which queries have tolerance to slightly stale data. Those queries can be executed on a read replica, while the rest should run on the primary node. Read replicas can also not accept any write queries.
Search
CloudSearch – requires little configuration and will scale automatically.
ES– offers an open source API and give you more control that just a search solution.