How to Increase Elasticity for Spiky POS Transaction Writes
A company has point-of-sale devices across thousands of retail shops that synchronize sales transactions with a centralized system. The system includes an Amazon API Gateway API that exposes an AWS Lambda function. The Lambda function processes the transactions and stores the transactions in Amazon RDS for MySQL. The number of transactions increases rapidly during the day and is near zero at night. How can a developer increase the elasticity of the system MOST cost-effectively?
Community Insight
The real bottleneck is concurrent writes to RDS, so the trap is picking read-replica auto scaling or the nonexistent SQS 'enhanced fanout' instead of a queue plus a concurrency ceiling on Lambda.
This DVA-C02 question tests how to make a write-heavy, bursty API Gateway–Lambda–RDS pipeline elastic on a budget. It establishes that buffering transactions through an Amazon SQS queue and capping Lambda reserved concurrency below the database connection limit (option D) is the only solution that actually relieves the write bottleneck.
Option C is the most frequent wrong pick: it repeats the valid SQS-to-Lambda decoupling but adds 'enhanced fanout,' a Kinesis Data Streams feature that does not exist for SQS or Lambda, making the whole option invalid. Options A and B are also popular yet useless because read replicas cannot absorb writes.
Community Discussion (51 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option D is the only choice that addresses the actual bottleneck, which is writes: the Lambda function "stores the transactions in Amazon RDS for MySQL," and every concurrent invocation can hold one or more connections against a fixed max_connections limit. Placing an Amazon SQS queue between the API and the function decouples the front end from processing, so the API responds instantly, transactions are buffered durably, and Lambda drains the queue at whatever rate the database can absorb. Setting reserved concurrency below the connection ceiling bounds the number of simultaneous writers, guaranteeing that connections are never exhausted while the queue soaks up the mid-day burst and drains to near zero overnight. Because idle capacity is not provisioned and nothing is dropped, this is the most cost-effective elasticity pattern for the described workload.
Why the Other Options Are Wrong
Options A and B both scale Aurora read replicas, but read replicas serve read traffic only; this workload is write-bound, so replicas add no write capacity and no elasticity to the spike. The chosen scaling trigger (CPU or connection count) is irrelevant when writes go to the primary instance, and migrating to Aurora increases cost without solving the problem. Option C is half right — an SQS queue that invokes Lambda is exactly the right decoupling — but "enhanced fanout" is an Amazon Kinesis Data Streams feature that provisions a dedicated 2 MB/s read slice per consumer; it does not exist for SQS or Lambda, so the option cannot be implemented as written. Only D is fully executable and directly targets the database connection ceiling.
Community Comment Notes
Most commenters land on D; Kirkster observes that "Neither A nor B will be of any use at all, because they say to scale out read replicas" and that "enhanced fanout is only for Kinesis-Lambda integration, not for SQS." JAMG54 and rcaliandro reach the same conclusion independently, with rcaliandro noting the question says it "stores the transactions in Amazon RDS" and therefore B's read replicas do not apply. Dissenting voices back C or B: Syre argues D creates a bottleneck, but throttling writers to protect the connection pool is the intended design — excess transactions wait safely in the queue instead of crashing the database. PVR cites the Aurora Auto Scaling documentation for B, yet that feature governs read capacity only, and sebasbonilla's claim that "Enhanced Fan-Out" applies to SQS is factually incorrect.
Official Reference
Exam Strategy
On DVA-C02 optimization questions, first identify the bottleneck direction — reads versus writes — because Aurora read-replica auto scaling is a distractor that only relieves reads. Then check each option for feasibility: any feature named for a different service (such as Kinesis enhanced fanout applied to SQS) invalidates the option immediately.
Frequently Asked Questions
Why don't Aurora read replicas fix this write-heavy POS workload?
Read replicas only serve read traffic; the transactions here are written to the MySQL primary. Adding or auto scaling replicas cannot relieve write load or connection pressure on the primary instance.
Is enhanced fanout a feature of Amazon SQS or Lambda?
No. Enhanced fanout is an Amazon Kinesis Data Streams feature giving each consumer a dedicated read throughput slice. SQS and Lambda have no such option, which invalidates option C.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →