
Answer-first summary for fast verification
Answer: Create a snapshot when tests are completed. Terminate the DB instance and restore the snapshot when required.
## Explanation **Correct Answer: C** - Create a snapshot when tests are completed. Terminate the DB instance and restore the snapshot when required. ### Why Option C is the Most Cost-Effective Solution: 1. **Cost Structure Analysis**: - RDS instances are billed by the hour when they're running - Snapshots are stored in S3 and billed at a much lower rate (GB-month) - The team only uses the database for 48 hours per month (2 days out of 30) 2. **Cost Comparison**: - **Option A (Stop/Restart)**: While stopping an RDS instance stops compute charges, you still pay for storage. This is better than running 24/7 but not optimal. - **Option B (Auto Scaling)**: RDS doesn't support true auto-scaling of instance types. You can only modify instance types manually or through automation. - **Option C (Snapshot/Terminate/Restore)**: - Terminate the instance → No compute charges - Store snapshot → Low S3 storage costs - Restore when needed → Only pay for compute during the 48-hour testing period - **Option D (Modify instance type)**: Still pays for compute 24/7, just at a lower rate 3. **Key Requirements Met**: - **No reduction in compute/memory attributes**: When restored, the instance has the same specifications - **Cost reduction**: Only pay for compute during actual usage (48 hours/month) - **Performance Insights**: Can be re-enabled when restoring from snapshot 4. **Operational Considerations**: - Restoring from snapshot takes time (depends on database size) - Need to plan for the restoration time before testing - Automated scripts can handle snapshot creation and restoration ### Why Other Options Are Less Cost-Effective: - **Option A**: Still pays for storage while stopped - **Option B**: Not applicable to RDS instance type changes - **Option D**: Still incurs compute charges 24/7, just at a lower rate ### Best Practice Implementation: ```bash # After testing completes aws rds create-db-snapshot \ --db-instance-identifier mydb \ --db-snapshot-identifier mydb-snapshot-$(date +%Y%m%d) aws rds delete-db-instance \ --db-instance-identifier mydb \ --skip-final-snapshot # Before next testing cycle aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier mydb \ --db-snapshot-identifier mydb-snapshot-latest ``` This approach maximizes cost savings while maintaining the required compute and memory attributes when the database is actually in use.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A development team runs monthly resource-intensive tests on its general purpose Amazon RDS for MySQL DB instance with Performance Insights enabled. The testing lasts for 48 hours once a month and is the only process that uses the database. The team wants to reduce the cost of running the tests without reducing the compute and memory attributes of the DB instance.
Which solution meets these requirements MOST cost-effectively?
A
Stop the DB instance when tests are completed. Restart the DB instance when required.
B
Use an Auto Scaling policy with the DB instance to automatically scale when tests are completed.
C
Create a snapshot when tests are completed. Terminate the DB instance and restore the snapshot when required.
D
Modify the DB instance to a low-capacity instance when tests are completed. Modify the DB instance again when required.