AWS Design Resilient Architectures 1 — Questions and Answers
Question 1: A company runs a critical e-commerce application on a single EC2 instance in one Availability Zone. During a recent AZ outage, the entire application was unavailable for several hours. Which architecture change would BEST address this single point of failure?
- Deploy the application across multiple EC2 instances in at least two Availability Zones behind an Application Load Balancer (Correct answer)
- Increase the instance size to a larger EC2 instance type for better performance
- Enable detailed CloudWatch monitoring on the single EC2 instance
- Create an AMI backup of the instance and store it in Amazon S3
Correct answer: Deploy the application across multiple EC2 instances in at least two Availability Zones behind an Application Load Balancer
Deploying across multiple Availability Zones behind an Application Load Balancer eliminates the single point of failure by distributing traffic across redundant infrastructure. If one AZ fails, the ALB automatically routes traffic to healthy instances in other AZs, ensuring high availability. Increasing instance size, enabling monitoring, or creating AMI backups do not address the fundamental issue of having a single point of failure in one AZ.
Question 2: An application tier communicates with a backend database. During peak traffic, the database becomes overwhelmed with connection requests, causing timeouts. The database itself has sufficient CPU and memory. Which solution would MOST effectively resolve this bottleneck without modifying the application code?
- Upgrade the RDS instance to a larger instance type
- Enable Multi-AZ on the RDS instance
- Deploy Amazon RDS Proxy between the application and the database (Correct answer)
- Create a read replica of the RDS instance
Correct answer: Deploy Amazon RDS Proxy between the application and the database
Amazon RDS Proxy sits between the application and the database and maintains a pool of established database connections. It allows many application connections to share fewer actual database connections, dramatically reducing connection overhead. Since the database has sufficient CPU/memory but is overwhelmed by connection volume, RDS Proxy directly addresses the root cause. Upgrading instance size won't fix connection exhaustion, Multi-AZ adds failover capability (not connection pooling), and read replicas handle read scaling but not connection pooling for the primary.
Question 3: A financial services company needs to replicate an RDS database to a second AWS Region for disaster recovery with a Recovery Point Objective (RPO) of under 1 second. Which approach meets this requirement?
- Configure automated RDS backups and copy snapshots to the DR region hourly
- Set up an RDS read replica in the DR region using cross-region replication (Correct answer)
- Enable RDS Multi-AZ and promote the standby in the DR region
- Use AWS Database Migration Service to continuously replicate data to the DR region
Correct answer: Set up an RDS read replica in the DR region using cross-region replication
RDS cross-region read replicas use asynchronous replication and typically achieve replication lag well under 1 second for most workloads, satisfying a sub-1-second RPO. Hourly snapshot copies would result in up to 1-hour RPO. RDS Multi-AZ provides high availability within a single region, not cross-region DR. AWS DMS is primarily a migration tool and introduces additional complexity without matching native read replica replication performance for ongoing DR.
Question 4: A company uses SQS to decouple its order processing system. Occasionally, messages fail processing repeatedly and never complete. These failed messages are blocking queue workers and consuming unnecessary resources. What is the recommended AWS solution?
- Increase the SQS message visibility timeout to prevent duplicate processing
- Enable SQS long polling to reduce the number of empty receives
- Configure a Dead Letter Queue (DLQ) with a maxReceiveCount to capture repeatedly failed messages (Correct answer)
- Switch from SQS Standard to SQS FIFO to guarantee message ordering
Correct answer: Configure a Dead Letter Queue (DLQ) with a maxReceiveCount to capture repeatedly failed messages
A Dead Letter Queue (DLQ) is specifically designed to handle messages that cannot be successfully processed after a configurable number of attempts (maxReceiveCount). When a message exceeds this threshold, SQS automatically moves it to the DLQ, preventing it from blocking the main queue and allowing engineers to inspect and reprocess failed messages separately. Increasing visibility timeout delays reprocessing but doesn't remove persistent failures. Long polling optimizes empty receive costs but doesn't handle failures. FIFO queues address ordering, not failure isolation.
Question 5: A web application hosted on EC2 instances behind an ALB experiences occasional traffic spikes that exceed current capacity, resulting in degraded performance. The load is highly variable and unpredictable. Which combination of services provides the MOST cost-effective and resilient solution?
- Use Reserved Instances sized for peak load with a CloudWatch alarm to send alerts during spikes
- Configure an Auto Scaling Group with a target tracking scaling policy based on average CPU utilization (Correct answer)
- Manually add EC2 instances before predicted peak times and terminate them afterward
- Use Dedicated Hosts to ensure consistent compute capacity during traffic spikes
Correct answer: Configure an Auto Scaling Group with a target tracking scaling policy based on average CPU utilization
An Auto Scaling Group with target tracking scaling automatically adds or removes EC2 instances based on real-time metrics like average CPU utilization. This provides elastic capacity that matches actual demand, ensuring resilience during spikes while minimizing cost during low-traffic periods. Reserved Instances for peak load means paying for peak capacity 24/7 even during off-peak times — very expensive. Manual scaling is error-prone and can't respond to unpredictable spikes. Dedicated Hosts are for licensing compliance, not elasticity.
Question 6: A startup stores all user-uploaded files in a single S3 bucket in us-east-1. They are concerned about a regional service disruption rendering their files unavailable. Which solution provides the HIGHEST durability and cross-region availability with the LEAST operational overhead?
- Write a Lambda function that copies new S3 objects to a bucket in a second region every 5 minutes
- Enable S3 Cross-Region Replication (CRR) to automatically replicate objects to a bucket in another region (Correct answer)
- Download all objects nightly and upload them to an EC2 instance in another region
- Enable S3 Versioning only, which protects against accidental deletion across all regions
Correct answer: Enable S3 Cross-Region Replication (CRR) to automatically replicate objects to a bucket in another region
S3 Cross-Region Replication (CRR) is a native S3 feature that automatically and asynchronously replicates objects to a destination bucket in a different region as soon as they are written, with no custom code or operational overhead. This provides both high durability and cross-region availability. A Lambda-based solution introduces delay (up to 5 minutes), additional cost, and operational complexity. Nightly downloads are error-prone, slow, and leave data at risk for up to 24 hours. S3 Versioning protects against deletion/overwrites but is region-scoped and doesn't address regional outages.
A company runs a critical e-commerce application on a single EC2 instance in one Availability Zone.
During a recent AZ outage, the entire application was unavailable for several hours.
Which architecture change would BEST address this single point of failure?