Design scalable and loosely coupled architectures

Concepts covered in Design scalable and loosely coupled architectures
API Management and Edge Caching Strategies
Global Attempts: 0Correct: 0 |  Incorrect: 0
Accuracy: 0%
Event-Driven and Loosely Coupled Messaging
Global Attempts: 0Correct: 0 |  Incorrect: 0
Accuracy: 0%
Horizontal and Vertical Scaling Strategies
Global Attempts: 0Correct: 0 |  Incorrect: 0
Accuracy: 0%
Purpose-Built Workload Technologies and Storage
Global Attempts: 0Correct: 0 |  Incorrect: 0
Accuracy: 0%
Serverless and Containerized Microservices
Global Attempts: 0Correct: 0 |  Incorrect: 0
Accuracy: 0%

Practice, Analyze & Improve

Dont just read—test your knowledge! Unlock the Student Workspace to take chapter tests and get instant performance insights.

Deep Analytics

Peer Comparison

Track Progress

Claim Free Account100% Free • No credit card required
Do you belong in the Top 10%?

Our analytics show that most students struggle with specific concepts in Design scalable and loosely coupled architectures. Take a free diagnostic test to generate your personal Learning DNA profile.

Practice Test – MCQs, True/False

Top

Multiple Choice Questions

A.

Configure AWS Systems Manager to vertically scale the EC2 instance types based on CloudWatch CPU metrics.

B.

Use Amazon Route 53 latency-based routing to distribute traffic to multiple independent EC2 instances running the web application.

C.

Vertically scale the Amazon RDS primary instance to a larger instance class to handle the increased web tier connection load.

D.

Implement horizontal scaling using an EC2 Auto Scaling group behind an Application Load Balancer, configured with a Target Tracking scaling policy based on CPU utilization.
Correct Answer: D

Solution:

The correct answer is D. Horizontal scaling adds or removes EC2 instances in response to changing demand. An Auto Scaling group behind an Application Load Balancer is well suited to stateless web servers because instances can be added during spikes and removed as demand falls. Target Tracking automatically adjusts capacity to maintain the configured metric near its target, reducing operational overhead compared with manually managing instance sizes. Option A is incorrect because vertically changing EC2 instance types is not an appropriate mechanism for rapid elastic scaling. Option B is incorrect because Route 53 is a DNS routing service and does not itself add or remove EC2 capacity. Option C is incorrect because vertically scaling the RDS instance does not address the stated web-tier compute bottleneck.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Network Load Balancer (NLB) with TLS listeners.

B.

Amazon CloudFront with AWS Global Accelerator.

C.

Application Load Balancer (ALB) with an EC2 Auto Scaling group.

D.

Classic Load Balancer (CLB) with SSL termination enabled.
Correct Answer: C

Solution:

The correct answer is C. An Application Load Balancer operates at Layer 7 and supports HTTP/HTTPS-aware routing, including path-based routing such as /trade and /portfolio. It can terminate TLS at the load balancer and distribute requests to multiple target groups. When the targets are managed by an EC2 Auto Scaling group, the application tier can scale horizontally. Option A is incorrect because an NLB operates primarily at Layer 4 and does not provide HTTP URL path-based routing. Option B is incorrect because CloudFront and Global Accelerator do not replace the regional Layer 7 load-balancing function required here. Option D is incorrect because Classic Load Balancer does not provide the required modern path-based routing capabilities.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Containerize the microservices and deploy them onto Amazon ECS using the AWS Fargate launch type, configuring independent Service Auto Scaling policies.

B.

Deploy each microservice onto its own dedicated EC2 Auto Scaling group utilizing compute-optimized and memory-optimized instance families.

C.

Scale the monolith vertically by migrating to an Amazon EC2 bare-metal instance to provide maximum localized compute and memory resources.

D.

Use AWS Elastic Beanstalk to deploy the microservices into a single environment, utilizing multi-container Docker platforms.
Correct Answer: A

Solution:

The correct answer is A. Amazon ECS with Fargate allows each microservice to run as an independent ECS service with its own task definition and Service Auto Scaling policy. This enables each service to scale horizontally according to its own CPU or memory requirements without managing the underlying EC2 host operating systems. Option B can provide independent scaling but introduces substantially more host and capacity-management overhead. Option C uses vertical scaling and does not provide independent horizontal scaling of the services. Option D places the services in a shared Elastic Beanstalk environment and does not provide the same independent service-level scaling model as separate ECS services.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

An Application Load Balancer (ALB) configured with a custom UDP listener and X-Forwarded-For headers.

B.

A Network Load Balancer (NLB) configured with TCP and UDP listeners.

C.

A Classic Load Balancer (CLB) with Proxy Protocol enabled.

D.

AWS Global Accelerator routed directly to an Amazon Route 53 Weighted routing policy.
Correct Answer: B

Solution:

The correct answer is B. A Network Load Balancer supports TCP and UDP traffic and is designed for high-throughput, low-latency Layer 4 workloads. For UDP target groups, client IP preservation is enabled by default, allowing backend EC2 instances to receive the client source IP. Option A is incorrect because an ALB does not support UDP listeners. Option C is incorrect because Classic Load Balancer does not provide the required UDP load-balancing capability. Option D is incorrect because Global Accelerator uses supported regional endpoints such as NLBs, ALBs, or EC2 resources; it does not route directly to a Route 53 routing policy.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Configure the ALB in us-east-1 to enable Cross-Zone Load Balancing across all global regions.

B.

Create an Amazon Route 53 record using a Latency routing policy pointing to the regional ALBs, with health evaluation enabled for the regional endpoints.

C.

Deploy AWS Direct Connect gateways in all three regions to bypass the public internet and reduce latency.

D.

Use Amazon CloudFront and configure the origin to use a Route 53 Geolocation routing policy pointing to the regional ALBs.
Correct Answer: B

Solution:

The correct answer is B. Route 53 latency-based routing selects among the configured regional endpoints based on the latency from the requesting user, and health evaluation allows an unhealthy regional endpoint to be excluded so another healthy endpoint can be selected. Option A is incorrect because ALB cross-zone load balancing distributes traffic across Availability Zones within the ALB's Region, not across Regions. Option C is incorrect because Direct Connect is primarily used for dedicated connectivity between networks and AWS, not for routing internet users to the lowest-latency application Region. Option D is incorrect because geolocation routing is based on the user's geographic location rather than measured network latency.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Configure an Application Load Balancer to distribute the SQS messages to an Auto Scaling group based on ActiveConnectionCount.

B.

Implement an Amazon EventBridge rule that triggers an AWS Lambda function to vertically scale the EC2 instances when the SQS queue depth increases.

C.

Configure an EC2 Auto Scaling group with a Target Tracking scaling policy based on the average CPU utilization of the worker instances.

D.

Configure an EC2 Auto Scaling group with a scaling policy based on the SQS ApproximateNumberOfMessagesVisible metric, with minimum capacity set to zero and scale-out/scale-in thresholds configured for queue backlog.
Correct Answer: D

Solution:

The correct answer is D. For an SQS-driven worker fleet, queue backlog is a more direct scaling signal than CPU utilization because the amount of work waiting in the queue determines how much processing capacity is required. The Auto Scaling group can use the SQS ApproximateNumberOfMessagesVisible metric to scale out when backlog increases and scale in when the queue remains empty, with minimum capacity set to zero to permit scale-to-zero behavior. A more sophisticated implementation can use backlog-per-instance metric math when maintaining a nonzero worker fleet, because AWS notes that raw queue depth does not necessarily scale proportionally with the number of workers. Option A is incorrect because an ALB does not distribute SQS messages. Option B is incorrect because vertically resizing EC2 instances is slower and less suitable than horizontal scaling for bursty queue processing. Option C is incorrect because CPU utilization is an indirect signal and may not accurately represent queued work.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Enable connection draining (deregistration delay) on the ALB target group and set the timeout to 900 seconds.

B.

Configure the Auto Scaling group termination policy to OldestInstance and enable EC2 instance termination protection.

C.

Switch the architecture to vertical scaling to avoid instance termination entirely during low demand periods.

D.

Modify the ALB to use a Network Load Balancer (NLB) which natively maintains persistent long-lived connections during scale-in.
Correct Answer: A

Solution:

The correct answer is A. When an Auto Scaling group scales in behind an Application Load Balancer, the selected instance is deregistered from the target group. Configuring the target group's deregistration delay to 900 seconds causes the ALB to stop sending new requests to the target while allowing in-flight requests to drain for up to 15 minutes before deregistration completes. This matches the stated maximum report duration. Option B is incorrect because termination protection prevents the instance from being terminated by the Auto Scaling group rather than providing graceful draining. Option C is unnecessary and does not provide elastic scale-out/scale-in. Option D is incorrect because changing the load balancer type does not inherently eliminate the need for deregistration/draining behavior.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Use a Target Tracking scaling policy based on Network In to automatically add instances as soon as the traffic hits the load balancer.

B.

Implement Step Scaling policies triggered by CloudWatch alarms when CPU utilization exceeds 70%.

C.

Configure Scheduled Scaling actions to proactively increase the desired capacity of the Auto Scaling group at 7:45 AM every weekday.

D.

Pre-warm the Application Load Balancer by submitting an AWS Support ticket prior to the 8:00 AM spike every day.
Correct Answer: C

Solution:

The correct answer is C. The workload has a predictable recurring traffic pattern and the EC2 instances require significant initialization time. Scheduled scaling can proactively add capacity before the expected 8:00 AM demand, giving the instances time to complete bootstrapping. Options A and B are reactive policies and may not provide capacity quickly enough after the traffic spike begins. Option D addresses neither the EC2 capacity requirement nor the instance initialization delay. For a recurring workload with historical daily or weekly patterns and long instance initialization times, predictive scaling is also an AWS-supported alternative, but it is not one of the answer choices.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Deploy an Application Load Balancer (ALB) and enable application-based cookie stickiness.

B.

Deploy a Network Load Balancer (NLB) and enable target group stickiness using source IP routing.

C.

Deploy a Classic Load Balancer (CLB) and configure TCP listeners with Proxy Protocol enabled.

D.

Deploy Amazon API Gateway with WebSocket APIs integrated directly to the EC2 instances.
Correct Answer: B

Solution:

The correct answer is B. A Network Load Balancer supports UDP traffic and target-group source-IP stickiness. This allows UDP traffic from a given source IP to be directed consistently to the same target while the stickiness state remains valid. Client IP preservation for UDP is also enabled by default for supported target groups. Option A is incorrect because ALB does not support UDP. Option C is incorrect because Classic Load Balancer does not provide the required UDP capability. Option D is incorrect because API Gateway WebSocket APIs are not a replacement for a raw UDP media transport. Source-IP stickiness should be used with awareness that multiple clients behind the same NAT source IP can be concentrated on the same target and that stickiness can be reset when target health or membership changes.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Enable Cross-Zone Load Balancing on the ALB to seamlessly synchronize the local memory across all EC2 instances.

B.

Change the instance type from memory-optimized (r5) to compute-optimized (c5) to process the shopping carts faster.

C.

Attach an Amazon EFS file system to all EC2 instances and configure the ALB to store session cookies on the shared disk.

D.

Externalize the session state by modifying the application to store the shopping cart data in an external datastore like Amazon ElastiCache or Amazon DynamoDB.
Correct Answer: D

Solution:

The correct answer is D. Horizontal scaling requires the application instances to avoid dependence on instance-local session state. If shopping-cart state remains only in one instance's RAM, requests routed to another instance can lose access to the user's session data. Externalizing session state to an appropriate shared datastore such as Amazon ElastiCache or DynamoDB allows instances to scale out and in independently. Option A is incorrect because ALB cross-zone load balancing distributes traffic across Availability Zones but does not synchronize EC2 memory. Option B is vertical scaling and does not address the requirement to exceed the capacity of a single instance. Option C is incorrect because an ALB does not store session cookies on EFS; shared file storage is also not the appropriate general-purpose mechanism for highly dynamic session state.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

A.

Use AWS Step Functions to route incoming HTTP requests directly to an Amazon EMR cluster for batch video processing.

B.

Implement Amazon API Gateway to cache the video uploads and throttle requests until the EC2 instances finish processing.

C.

Separate the application into two EC2 Auto Scaling groups. Introduce an Amazon SQS queue between them to buffer the video processing jobs, allowing the processing tier to scale based on queue depth.

D.

Place an Application Load Balancer between the web frontend tier and the video processing tier, configuring synchronous HTTP callbacks.
Correct Answer: C

Solution:

The correct answer is C. Separating the web and processing tiers into independent Auto Scaling groups removes their resource contention. Amazon SQS provides asynchronous buffering between the tiers: the web tier can accept the upload and enqueue a processing job, while the worker tier consumes jobs independently and scales according to the backlog. Option A is incorrect because Step Functions is an orchestration service and EMR is intended for distributed data-processing workloads rather than being a general video-compression ingress architecture. Option B is incorrect because API Gateway is not a general-purpose cache for large video uploads and throttling does not create asynchronous decoupling. Option D is incorrect because synchronous HTTP communication keeps the web tier dependent on the processing tier and can propagate latency and failures.

Chapter Concept:

Horizontal and Vertical Scaling Strategies

Unlock the Detailed Solution
Sign in to view options, correct answers, and step-by-step logic.

A.

Amazon Kinesis Data Streams configured with a partition key based on the user ID to ensure ordered processing.

B.

Amazon SNS FIFO topic subscribed directly by the backend EC2 instances.

C.

Amazon SQS Standard queue combined with an AWS Lambda function implementing custom deduplication logic via Amazon DynamoDB.

D.

Amazon SQS FIFO queue with a unique MessageDeduplicationId for each order and the same MessageGroupId for all orders to enforce a single strict ordering sequence.
Correct Answer: D

Solution:

The correct answer is D. Amazon SQS FIFO is the appropriate managed queue when strict ordering and producer-side duplicate suppression are required. Using the same MessageGroupId for all orders places every order in one ordered message group, ensuring that messages in that group are processed sequentially. MessageDeduplicationId prevents duplicate sends with the same deduplication ID from being delivered within the five-minute deduplication interval. However, an important distinction is that SQS FIFO does not provide an absolute end-to-end guarantee that an application-side business operation can never execute twice—for example, a consumer could complete a database charge and fail before deleting the message. The payment/ticket-allocation operation should therefore also be idempotent. Option A provides per-shard ordering but requires application-level handling for duplicate processing. Option B is not appropriate because SNS FIFO is a publish/subscribe topic and EC2 consumers do not directly pull messages from an SNS topic. Option C lacks strict FIFO ordering and requires substantially more custom logic.

Chapter Concept:

Event-Driven and Loosely Coupled Messaging

Unlock the Detailed Solution
Sign in to view options, correct answers, and step-by-step logic.

A.

Create an Amazon SNS topic triggered by S3 Event Notifications. Subscribe three separate Amazon SQS Standard queues to this SNS topic. Configure each microservice to poll its respective SQS queue.

B.

Create a single Amazon SQS Standard queue triggered by S3 Event Notifications. Have all three microservices simultaneously poll this shared queue, utilizing message visibility timeouts to prevent duplicate processing.

C.

Configure S3 Event Notifications to send payloads directly to an AWS Step Functions state machine that uses a Parallel state to synchronously invoke three separate AWS Lambda functions.

D.

Create an Amazon EventBridge event bus. Configure a single rule that targets a single Amazon Kinesis Data Stream. Configure the three microservices as independent consumers of the Kinesis stream.
Correct Answer: A

Solution:

The correct answer is A. This is the classic pub/sub fan-out pattern combined with durable queues. S3 publishes the event to an Amazon SNS topic, and each downstream service has its own SQS queue subscription. Each queue receives an independent copy, so an unavailable service accumulates its messages without affecting the other services. Option B is incorrect because multiple services consuming the same SQS queue compete for messages; each message is delivered to one consumer rather than independently to all three services. Option C provides orchestration rather than durable independent buffering for each downstream service. Option D could be used for event distribution, but a single Kinesis stream is not the simplest independent durable queue-per-consumer pattern for this requirement.

Chapter Concept:

Event-Driven and Loosely Coupled Messaging

Unlock the Detailed Solution
Sign in to view options, correct answers, and step-by-step logic.

A.

Amazon API Gateway configured with custom AWS Lambda authorizers and mapping templates.

B.

Amazon EventBridge utilizing content-based filtering rules, input transformers, and API destinations for the external HTTPS webhooks.

C.

Amazon SNS utilizing message filtering policies and an integrated AWS Glue DataBrew job.

D.

Amazon SQS with AWS Lambda event source mappings containing custom Python transformation logic.
Correct Answer: B

Solution:

The correct answer is B. Amazon EventBridge provides event-pattern filtering and input transformation, allowing events to be routed according to fields such as user region and transformed into the required target payload without custom compute for basic transformations. EventBridge API destinations can invoke external HTTPS endpoints. Option A is primarily an API ingress and management service and would require additional routing logic for this event-driven use case. Option C introduces DataBrew, which is not a real-time event transformation service. Option D requires custom Lambda code for the transformations, increasing operational overhead.

Chapter Concept:

Event-Driven and Loosely Coupled Messaging

Unlock the Detailed Solution
Sign in to view options, correct answers, and step-by-step logic.

A.

Replace API Gateway with an Application Load Balancer (ALB) and deploy the Lambda functions as targets to enable HTTP connection draining.

B.

Configure API Gateway to route traffic directly to an Amazon Kinesis Data Firehose delivery stream, buffering orders directly into an Amazon S3 bucket.

C.

Integrate API Gateway directly with an Amazon SQS queue. Configure the Lambda functions to consume messages from the queue at a controlled concurrency rate and write them to the RDS database.

D.

Increase the AWS Lambda concurrent execution limit to 15,000 and deploy Amazon RDS Proxy between the Lambda functions and the database.
Correct Answer: C

Solution:

The correct answer is C. API Gateway can use an AWS service integration to place orders directly into Amazon SQS. The queue absorbs traffic bursts, while Lambda consumes messages asynchronously through an event source mapping with controlled concurrency, allowing the RDS database to process writes at a sustainable rate. This removes the synchronous dependency between the request path and the database. Option A does not provide durable request buffering. Option B is primarily a streaming-delivery-to-storage solution and is not appropriate for transactional order processing. Option D may improve database connection management with RDS Proxy, but simply increasing concurrency does not decouple the database from the burst and can still overwhelm its processing capacity.

Chapter Concept:

Event-Driven and Loosely Coupled Messaging

Unlock the Detailed Solution
Sign in to view options, correct answers, and step-by-step logic.
Experience the StudyTunnel Method

We do not just give you mock tests. We guide you through a gamified, AI-driven learning path designed to guarantee mastery.

Step 1: Practicing the Concepts

Design scalable and loosely coupled architectures

Step 2: Master Boss Exam
Locked • Full Phase Assessment
Step 3: Redemption Arena
Locked • AI Weakness Tracker