AWS RDS Best Practices
reference: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_BestPractices.html
Basic operational guidelines
- use metrics to monitor memory, CPU, replica log, storage usage. (AWS CloudWatch)
- scale up resource when approaching limits, have some buffer to accommodate sudden increases in demand
- enable period backups, schedule for daily low in write IOPS
- do not cache DNS for more than 30 seconds because the IP of a DB instance can change after a failover
- do failover test
- keep DB versions up to date
- test in staging env
- use Amazon RDS managed upgrades
- schedule major version upgrades
- use AWS suite of drivers for application connectivity
- use enhanced monitoring to identify OS issues
- use metrics to identify performance issues
- establish a baseline performance metrics for "normal" workload
- establish a baseline for "replica lag" if using multi-AZ DB
- create a performance analysis report
RAM recommendations
- RAM should be good enough so that working set should reside almost completely in memory
- use CloudWatch to monitor ReadIOPS, it should be stable overtime
Best practices for working with PostgreSQL
- Loading data into a DB instance
- PostgreSQL autovacuum feature