You absolutely should. There are many issues with MySQL but I’ll give you a very compelling one.
Let’s say you want to use a database transaction while you’re modifying your table structure to ensure if something goes wrong your data is screwed (causing you to have to restore a backup, etc).
With MySQL any table alterations will persist even though data modifications will be rolled back.
With Postgres, if you cancel/rollback that transaction it all goes back to exactly how it was before.
Another great example is the unique constraint enforcement.
In Postgres if you want to swap two unique values between two rows, you just put it in a transaction and do it.
In MySQL, you have to set one of the values to a temporary garbage value, then change the other value, then change the temporary garbage value to what it should’ve been.
Another example, if you have a column that’s INTNOTNULL…
If you insert a NULL, Postgres will give you an error, MySQL will silently insert 0.
I don’t know exactly what environment you’re working, but Postgres has a reputation as the best DBMS to work with from a developer’s perspective. I definitely feel that way, at least.
What type of lab are you working in, and what other technologies do you work with?
I’m the director of technology for a neurology lab, where we collect patient health record data in a variety of disparate machines and modalities (e.g., MRI, EEG, physical functioning, retinal scans, etc.). We’ve been using the open-source database software REDCap (basically a wrapper for MySQL that enables easy GUI-based data entry), but we are reaching the limits of what it can handle and need something that can scale with our growing database.
I have little experience in database management myself, but I am a competent programmer and feel comfortable learning whatever is needed (famous last words, I know).
I have experience running both at global scale (self managed, AWS RDS & GCP CloudSQL). Developer experience = postgres, management/sysadmin = MySQL/maria
Can you elaborate? I’m deciding on what type of SQL to use for my lab and am thinking about MySQL. Should we reconsider?
You absolutely should. There are many issues with MySQL but I’ll give you a very compelling one.
Let’s say you want to use a database transaction while you’re modifying your table structure to ensure if something goes wrong your data is screwed (causing you to have to restore a backup, etc).
With MySQL any table alterations will persist even though data modifications will be rolled back.
With Postgres, if you cancel/rollback that transaction it all goes back to exactly how it was before.
Another great example is the unique constraint enforcement.
In Postgres if you want to swap two unique values between two rows, you just put it in a transaction and do it.
In MySQL, you have to set one of the values to a temporary garbage value, then change the other value, then change the temporary garbage value to what it should’ve been.
Another example, if you have a column that’s
INT NOT NULL
…If you insert a NULL, Postgres will give you an error, MySQL will silently insert 0.
I don’t know exactly what environment you’re working, but Postgres has a reputation as the best DBMS to work with from a developer’s perspective. I definitely feel that way, at least.
What type of lab are you working in, and what other technologies do you work with?
I’m the director of technology for a neurology lab, where we collect patient health record data in a variety of disparate machines and modalities (e.g., MRI, EEG, physical functioning, retinal scans, etc.). We’ve been using the open-source database software REDCap (basically a wrapper for MySQL that enables easy GUI-based data entry), but we are reaching the limits of what it can handle and need something that can scale with our growing database.
I have little experience in database management myself, but I am a competent programmer and feel comfortable learning whatever is needed (famous last words, I know).
I have experience running both at global scale (self managed, AWS RDS & GCP CloudSQL). Developer experience = postgres, management/sysadmin = MySQL/maria