AWS RDS Benchmarking
Benchmarking PostgreSQL vs MySQL on AWS RDS with HammerDB TPC-C workloads
Kristin Henderson and Jaren Shead
Fall 2024
Overview
This team project compared PostgreSQL and MySQL performance on Amazon RDS under identical configurations. Benchmarks ran with HammerDB 4.12 on an EC2 t2.micro instance, using a TPC-C transactional workload which simulates an online wholesale supplier. Both databases used the same configuration: db.t4g.micro instances with 20 GiB of gp3 storage. CloudWatch recorded CPU, IOPS, and memory before, during, and after each run.
On this write-heavy workload, MySQL ran roughly 4.5 times more transactions per minute than PostgreSQL (4,058 vs. 888), and with less than half the latency (179.6 ms vs. 448.5 ms). The two databases are built for different priorities. MySQL’s InnoDB storage engine is tuned for fast writes and handling many transactions at once. PostgreSQL uses Write-Ahead Logging (WAL) to protect data through crashes, and its query planner is built to handle more complex queries.
The right database depends on the workload. MySQL is a good fit for write-heavy or latency-sensitive applications. PostgreSQL works better when reads or complex queries are more common.
Results at a glance
Skills
AWS · Amazon RDS · EC2 · CloudWatch · PostgreSQL · MySQL · HammerDB · Performance benchmarking