SAP-C02 practice question 3 of 35

A company is running a two-tier web-based application in an on-premises data center. The application layer consists of a single server running a…

Full set: 689 questions

Domain Design Solutions for Organizational Complexity

A company is running a two-tier web-based application in an on-premises data center. The application layer consists of a single server running a stateful application. The application connects to a PostgreSQL database running on a separate server. The application’s user base is expected to grow significantly, so the company is migrating the application and database to AWS. The solution will use Amazon Aurora PostgreSQL, Amazon EC2 Auto Scaling, and Elastic Load Balancing. Which solution will provide a consistent user experience that will allow the application and database tiers to scale?
Answer options
A: Enable Aurora Auto Scaling for Aurora Replicas. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
B: Enable Aurora Auto Scaling for Aurora writers. Use an Application Load Balancer with the round robin routing algorithm and sticky sessions enabled.
C: Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled. Correct answer
D: Enable Aurora Scaling for Aurora writers. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
Correct Answer:
C. Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled.
Explanation

The solution must address scaling for both the stateful application tier and the database tier.
1. Stateful Application Tier: The application is stateful, meaning user session data is stored on the specific EC2 instance they are connected to. To ensure a consistent user experience as the application scales horizontally with an Auto Scaling group, the load balancer must direct all requests from a user's session to the same instance. An Application Load Balancer (ALB) with sticky sessions (session affinity) enabled is the standard and most effective way to achieve this for web applications.
2. Database Tier: Amazon Aurora has a single writer instance and can have multiple read replicas. To scale database read capacity, which is common for web applications, you add more read replicas. Aurora Auto Scaling is a feature specifically designed to automatically adjust the number of Aurora Replicas based on performance metrics like CPU utilization, thus scaling the database's read throughput. You cannot "auto scale" the number of writer instances. Therefore, combining an ALB with sticky sessions for the application and Aurora Auto Scaling for the read replicas provides a complete, scalable, and consistent solution.

Why Incorrect

A: A Network Load Balancer (NLB) does not support the "least outstanding requests" routing algorithm; it uses a flow hash algorithm. While it supports sticky sessions, an ALB is generally better suited for HTTP/HTTPS web traffic. B: "Aurora Auto Scaling for Aurora writers" is incorrect. An Aurora cluster has only one writer instance. Scaling the writer is a vertical scaling operation (changing instance size), not an auto-scaling of the instance count. D: This option is incorrect for two reasons: it incorrectly suggests auto-scaling Aurora writers, and it incorrectly pairs the "least outstanding requests" algorithm with a Network Load Balancer.

References

1. AWS Documentation - Elastic Load Balancing

Application Load Balancers: "Sticky sessions are a mechanism to route requests from the same client to the same target. Elastic Load Balancing supports sticky sessions for Application Load Balancers." (Source: AWS Documentation

User Guide for Application Load Balancers

section on "Sticky sessions").

2. AWS Documentation - Amazon Aurora: "With Aurora Auto Scaling

you can have Amazon Aurora automatically adjust the number of Aurora Replicas in an Aurora DB cluster... Aurora Auto Scaling is useful for workloads that have predictable cyclical traffic patterns or unpredictable traffic spikes." (Source: AWS Documentation

Amazon Aurora User Guide

section on "Using Amazon Aurora Auto Scaling with Aurora replicas").

3. AWS Documentation - Amazon Aurora Architecture: "Every Aurora DB cluster has one primary DB instance [writer]... An Aurora DB cluster can also have up to 15 Aurora Replicas... Aurora Replicas are used for read scaling." (Source: AWS Documentation

Amazon Aurora User Guide

section on "Amazon Aurora DB clusters").

4. AWS Documentation - Elastic Load Balancing

Network Load Balancers: "The load balancer routes each request to a single target in a target group. The routing algorithm it uses is a flow hash algorithm." (Source: AWS Documentation

User Guide for Network Load Balancers

section on "Routing").

Scroll to Top