Question

Difficulty: HardManaging Storage and Data Transfer Costs

A financial services company runs a high-throughput transaction reporting application in the `us-west-2` Region. The application's compute layer consists of Amazon EC2 instances in an Auto Scaling group distributed across 33 Availability Zones (`us-west-2a`, `us-west-2b`, and `us-west-2c`). The database layer is an Amazon Aurora PostgreSQL cluster consisting of 11 writer instance in `us-west-2a` and 33 reader instances distributed across the same 33 Availability Zones (one reader per zone).

The application EC2 instances perform intensive read operations, querying the database cluster using the default Aurora Reader endpoint. The database traffic amounts to approximately 150 TB150\text{ TB} of data read per month. The company's monthly AWS bill shows a significant charge for cross-AZ data transfer between the EC2 instances and the Aurora reader instances.

A solutions architect must optimize the database architecture to minimize these cross-AZ data transfer costs without modifying the application code, except for database connection strings.

Which of the following is the most cost-effective and operationally sound solution?

  1. Create three custom endpoints in the Aurora cluster, one for each Availability Zone, and associate each custom endpoint with the reader instance located in that specific Availability Zone. Configure the application connection pool on the EC2 instances in each Availability Zone to connect to their corresponding local custom reader endpoint.Answer
  2. B
    Deploy an Amazon RDS Proxy cluster with an endpoint in each of the three Availability Zones. Configure the EC2 instances in each Availability Zone to connect to the RDS Proxy endpoint in their local zone, allowing RDS Proxy to pin read connections to the local reader instance.
  3. C
    Configure a Route 53 Private Hosted Zone with latency-based routing records that map the database hostname directly to the private IP addresses of the individual Aurora reader instances. Have the EC2 instances use these records to connect to the closest reader.
  4. D
    Configure Amazon Aurora Auto Scaling with a scaling policy based on the average database connection count. This will dynamically scale the number of reader instances in each Availability Zone to match the EC2 instance count, ensuring traffic remains local.

Answer

Create three custom endpoints in the Aurora cluster, one for each Availability Zone, and associate each custom endpoint with the reader instance located in that specific Availability Zone. Configure the application connection pool on the EC2 instances in each Availability Zone to connect to their corresponding local custom reader endpoint.
The correct solution uses Aurora custom endpoints to group the reader instances by Availability Zone. Since cross-AZ data transfer within a VPC incurs charges, routing the EC2 application traffic to a reader instance in the same Availability Zone eliminates these data transfer costs. Custom endpoints are operationally sound because they are native Aurora DNS endpoints that automatically track the health of the associated instances, avoiding the need for manual IP tracking or application-level routing.

Step-by-Step Solution

1
Identify the source of the cost: cross-Availability Zone database read traffic.
Database traffic of approximately 150 TB150\text{ TB} per month is being routed across Availability Zones, incurring substantial data transfer charges.
By default, the Aurora Reader endpoint routes traffic round-robin across all readers in the cluster, regardless of their Availability Zone location.
2
Evaluate the architectural options to achieve Availability Zone affinity.
Aurora custom endpoints allow grouping specific DB instances and expose them via unique DNS hostnames.
Grouping reader instances by Availability Zone ensures that connection requests can be localized.
3
Create and configure custom reader endpoints.
Three custom endpoints are created, each containing only the reader instance residing in that respective Availability Zone.
This guarantees that any connection to a specific custom endpoint will only route to the reader in that specific Availability Zone.
4
Configure the application database connection strings in each Availability Zone.
EC2 instances in each Availability Zone are configured to use their local custom endpoint hostname.
This routes all read queries to the local reader, completely bypassing cross-AZ paths and eliminating the associated data transfer charges.

Key Concept

Using Aurora custom endpoints to enforce Availability Zone affinity for database read traffic to eliminate cross-AZ data transfer costs.
Rate this question