DEV Community

Discussion on: Should I use SQLite, PostgreSQL, or MySQL?

Collapse
 
dsonck92 profile image
Daniel Sonck

Extending on Jacob's points, one that I find inexcusable (and has in fact hit me in the face a few moments ago at work) is the fact that MySQL does not support Transactional DDL and only supports Atomic DDL starting from 8.0. Whereas both PostgreSQL and SQLite support this.

To specify it's significance for those unaware: say your application manages migrations and needs to do several steps in one go (e.g. alter some column name and some data modification), you should be able to start a transaction and run all steps. If something goes wrong (e.g. the application is somehow terminated mid-migration, as happened here), then all migration steps are perfectly reverted. Hence it will be completely ready for a new apply, or, you can go back to the old version of the software and you know the database should be in a state as if there was no update whatsoever.

Yes, this can be alleviated by making a backup before upgrading, which we did, but it's also demonstrated by two systems, one of which (SQLite) I always saw as a simplistic database, that it can be done. I can kill the application modifying the schema of an SQLite database without any ill effects.