Yiwei Yu

Posted on: 2025-01-02

PostgreSQL and MySQL

Let's start with the conclusion: my opinion is that PostgreSQL is superior to MySQL. 

Here is why I made this conclusion:

When I was developing this blog project, I originally used MySQL. After the development was completed, I rented an instance from LightSail that only has 1GB of memory. After installing some fundamental software such as JVM, MySQL, Nginx, and fail2ban, I ran my jar package. And you know what, as long as the jar file runs, the whole instance will crash due to lack of memory in less than 10 seconds! 

Then I checked the memory and found that the Spring Boot's jar file requires about 340MB of memory to run, Ubuntu and other basic software require about 360MB of memory, and, the MySQL actually requires about 400MB of memory to run!

Then I replaced MySQL with PostgreSQL, and all the software could run smoothly, for PostgreSQL only requests about  80M of memory to run. Not to mention that PostgreSQL's performance and efficiency are no lower than MySQL's.

PostgreSQL

MySQL

The above two figures show the memory usage of PostgreSQL and MySQL when running on my MacOS.




Comments (
)
Sign in with Google account
0/500
Comment

Copyright © 2024 - 2025  Yiwei Yu       |        Designed  And  Built  By  Yiwei Yu       |       Email :  hiyiweiyu@gmail.com       |       Privacy Policy