Which solution will meet these requirements?
Increase the size of the DB instance to an instance type that has more available memory.
Modify the DB instance to be a Multi-AZ DB instance. Configure the application to write to all active RDS DB instances.
Modify the API to write incoming data to an Amazon Simple Queue Service (Amazon SQS) queue. Use an AWS Lambda function that Amazon SQS invokes to write data from the queue to the database.
Modify the API to write incoming data to an Amazon Simple Notification Service (Amazon SNS) topic. Use an AWS Lambda function that Amazon SNS invokes to write data from the topic to the database.
Explanations:
Increasing the size of the DB instance might provide more resources, but it does not address the connection limits or the potential for data loss during heavy traffic periods. The core issue is the high write traffic, which requires a different solution than simply scaling the instance.
Modifying the DB instance to be a Multi-AZ deployment enhances availability and durability but does not alleviate the issue of write traffic during peak times. Writing to all active RDS instances in a Multi-AZ setup is not feasible, as the primary instance handles all write operations, and there is no load balancing for writes across instances.
Using Amazon SQS to queue incoming data decouples the API from the database, allowing it to handle bursts of incoming requests without overwhelming the database. A Lambda function can process messages from the SQS queue asynchronously and write to the database, ensuring that no data is lost during high traffic and minimizing direct connections to the database.
While Amazon SNS can also decouple the API from the database, it is designed for pub/sub messaging rather than for queuing messages. It does not guarantee message order and might result in message loss or duplication, which is not suitable for this scenario where ensuring data integrity during high traffic is critical.