When should I upgrade to MySQL / PostgresQL from H2

Hello all,

I love the application and am using the basic docker image to run it but I am wondering what kinds of indicators I should look for regarding the database back end decisions.

What are good indicators that we should move away from the H2 implementation vs a PostgreSQL/MySQL?

I’d prefer to make decisions with the future in mind but I admittedly don’t know if we will ever push the application hard enough to justify needing a second container running the database. I’d like to get load balancing setup but I don’t actually think we will need it.

Hi @vesti

If you’re using Metabase for anything other than testing, then you should migrate away from H2.

H2 can easily become corrupted in case of improper shutdown. And can also become large and slow because cleanup processes can only be run when Metabase is shutting down.

And since H2 is a single-file database, when only a single process can write to the file, so you cannot run multiple Metabase instances for load balancing with that database.

All in all, I would recommend that you migrate away, but you have to do what feels best/easiest for your setup.
If you continue to run with H2, then make sure you have proper backups.

EDIT: Before you make your final decision, then you should search the forum/Github and see how many people who have ended up with a corrupted H2 (and sadly usually without backups too).

Awesome thank you so much for the feedback.

I’ve actually got a wildly successful instance of the H2 running in a Docker container. The instance has been through shutdowns and server crashes (my testing rig power supply isn’t reliable) without any fault to Metabase, it’s dashboards, saved queries, or permissions.

I’m glad to know mine is doing so well compared to what sounds like the norm. I’ve taken regular image based snapshots of the instance running in Docker so I have a good working history of it’s development and plan to migrate it to another more stable system. I’m going to go on ahead and setup a Postgres instance now while I’m already working on it.

Thank you again,