1

Nitro does not support MySQL for Apple Silicon, but you can use MariaDB interchangeably.

I'm using an Apple Silicon computer, and my server run with MySQL only.

However, as read in the Craft Database Options and Best Practices:

(...) For each build, you should pick an engine and stick with it. Moving from MySQL to PostgreSQL (or vice-versa) can be painful and error-prone, and even finer differences between MySQL and MariaDB can cause issues.

How would it be risky to development under MariaDB and then go live with a MySQL setup? What are these potential issues, and how to override them?

1 Answer 1

1

My view on this would be it's risky because any environments for a project should ideally all match the same core versions of CMS, PHP version (at minimum same major version) and whatever database engine. If you use a different database engine on one environment compared to another you no longer have a consistent testing environment path e.g. development, staging, production.

While MariaDB is intended to be a "drop in" replacement, it isn't a 1:1 match, for example see: https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/. Whether or not any of these incompatibilities would be a problem for you, you'd have to review it.

You are also potentially opening up yourself for headaches with harder debugging if things don't work. For example, what if a DB query does not consistently return the expected result across both MariaDB and MySQL? What if it worked under MariaDB and then behaved differently under MySQL, granted in a lot of cases this probably wouldn't happen and possibly was more likely in older versions, but it's the same principle of even doing something like MySQL 5.7 on your development environment but then using MySQL 8.0 on production. You can't accurately test your app with confidence now, as there's a major version difference between the environments.

Stick to one consistent database engine and major version across all environments, otherwise you are potentially putting yourself in a position that could come back to bite you would be my take. As developers we deal with variables a lot. This is probably one variable you want as a constant no matter what.

2
  • Ok, thank you. I hope the Craft team could argue for these points. It's a bit tricky to take consideration of all these potential issues at the point of starting a new project. That's a shame that their Nitro tool isn't ready for the latest Mac: craftcms.com/docs/nitro/2.x/installation.html Jun 24 at 7:19
  • @RomainPoirier It might be worth highlighting that Nitro 3.x is in development. I haven't followed the development that closely to know if MySQL 8 is supported under 3.x for M1 Mac. Failing that you could ask the Nitro devs if MySQL 8 support has changed on the GitHub repo for clarification. Jun 24 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.