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 Availability Zones (`us-west-2a`, `us-west-2b`, and `us-west-2c`). The database layer is an Amazon Aurora PostgreSQL cluster consisting of writer instance in `us-west-2a` and reader instances distributed across the same 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 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?
- 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
- BDeploy 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.
- CConfigure 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.
- DConfigure 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.