AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A global e-commerce company uses an Amazon RDS for PostgreSQL Single-AZ database to manage its product catalog and user data. During peak traffic, the application experiences significant performance degradation due to high read load on the database. The development team has identified that most of the read operations, such as browsing products, do not require real-time data and can tolerate a few seconds of replication lag. However, a critical requirement is that when users update their profile information, subsequent reads of their own profile must reflect the changes immediately to avoid a poor user experience.
A solutions architect needs to design a solution that improves read performance while ensuring read-after-write consistency for user-specific updates. Which approach should the architect recommend?
Deploy multiple RDS Read Replicas in different Availability Zones. Configure the application to route general read queries, like product catalog browsing, to the read replica fleet. For user-specific data, modify the application to direct all read queries for a user to the primary database instance for a set duration immediately following a write operation by that same user.
Implement Amazon ElastiCache for Redis as a caching layer in front of the RDS database. Configure the application to read from the cache first and only query the database on a cache miss. Use a write-through caching strategy to keep the cache and database synchronized.
Create a cross-region read replica in a different AWS Region. Use an Amazon Route 53 latency-based routing policy to direct read queries from global users to the replica with the lowest latency and send all write traffic to the primary database.
Migrate the database to an Amazon Aurora PostgreSQL cluster. Use the reader endpoint for all read traffic and the cluster endpoint for all write traffic. Rely on Aurora's shared storage architecture to ensure all reads are consistent.
The correct option is to deploy RDS Read Replicas and modify the application logic. This approach addresses both requirements effectively. General read traffic is offloaded to the read replicas, which alleviates the performance bottleneck on the primary instance. The critical requirement for read-after-write consistency is met by implementing an application-level pattern where, for a limited time after a user performs a write, their subsequent read requests are directed to the primary database instance, guaranteeing they see their own updates.
Incorrect options:
Migrate to Aurora: While migrating to Amazon Aurora and using the reader endpoint is a powerful performance strategy, it does not guarantee immediate read-after-write consistency. Aurora replicas have very low replication lag (often sub-100ms) due to the shared storage architecture, but replication is still asynchronous. This means there is still a small window where a read could be served stale data from a replica, which violates the strict consistency requirement.
Implement ElastiCache: Adding a caching layer like ElastiCache is a common pattern for improving read performance. However, a simple write-through strategy does not inherently solve the read-after-write consistency problem for the user. It adds another system to manage and requires complex logic to ensure that a user's reads are not served stale data, especially in a distributed application environment.
Create a cross-region replica: Using a cross-region read replica with Route 53 latency-based routing is a pattern designed for disaster recovery and for reducing read latency for a globally distributed user base. This solution would increase, not decrease, the replication lag due to network distance between regions, making the eventual consistency problem more pronounced and failing to meet the immediate consistency requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are RDS Read Replicas, and how do they work?
Open an interactive chat with Bash
How does read-after-write consistency work in the recommended solution?
Open an interactive chat with Bash
Why doesn't Amazon Aurora guarantee read-after-write consistency for this use case?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Design for New Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access