Join GitHub today
Recommend PostgreSQL instead of MariaDB/MySQL #5912
I wish PostgreSQL in general was better supported. In MariaDB/MySQL you have to mess around with UTF8mb4 if you want 4-byte support, which is default in PostgreSQL UTF8.
PostgreSQL feels like a better DB in general. Would be nice if Nextcloud decided to go down that path instead of recommending a less advanced (and IMHO) worse DB.
I'm writing this after I have been messing with MariaDB for hours to activate 4 byte support, which only took a few minutes in PostgreSQL (aka apt install postgresql). According to the IRC channel (#posgresql) UTF8mb4 is just something that MariaDB/MySQL came up with becuase they messed up the original code and had to make a quick fix to solve it. That doesn't sound good to me. Also UTFmb4 is considered "experimental" according to docs which isn't the case with PostgreSQL as it just works out of the box.
@MorrisJobke said that MariaDB/MySQL was performing better when tested in a clustered environment, but my guess is that that test was some time ago. Maybe you should consider making PostgreSQL the recommended DB after all?
Also, this is not just about UTF8mb4, I'm talking generally. There are a lot to gain in using PSQL any other DB IMHO. According to several hours of reading I did comparing and testing the alternatives.
Taken from here: #5909 (comment)
This is not about feeling. This is the recommendation, because in bigger setups we had better experience with it and we know how to handle.
Nevertheless Postgres and Mysql are supported and you should be free to use any of them.
And we will not recommend something were we have less detailed expertise. So I will close this for now. If there is a bug with Postgres: report it.
Yeah, I get advocacy for PGSQL - and you can do that, this is an open project. Organize and execute testing, write blogs about how to install and optimize it and so on! I'm happy to promote it. Heck, write a blog post "making the case for PostgreSQL with Nextcloud" and I'll publish it on our blog. But I'll allow any MySQL or MariaDB supporter to write one about MySQL/MariaDB of course!
That proves to me that the choice is quite personal for you as well. Of course you tend to recommend something that you are more familiar with and can support in a better way than the alternative. I do the same, all the time. Like I recommend Nextcloud instead of ownCloud because I think that Nextcloud is the better choice. That's also why I now, after I tested it myself, will recommend PostgreSQL rather than something else.
It's quite obvious to me that MySQL MariaDB is recommended because most of the Nextcloud devs are familiar with it, and because of that also have better knowledge in how to set it up. That might explain why it worked better than PostgreSQL.
I will not fight you about this and it's not my intention to waste your time or anything like that, but again I've done a lot of reading and testing since I now also maintain a PostgreSQL VM and I can say from my own experience that have noticed that PostgreSQL is faster, easier to setup (at least I think as it's fewer lines of bash commands), more secure, and a more advanced database in general. Maybe "feel" was the wrong word, maybe I should say --^ instead.
Nevertheless, I'm grateful that Nextcloud supports PostgreSQL but recommending a database also mean that app developers won't bother to support the alternative if they don't have to. Most of the apps work with PostgreSQL but some don't and a warning pops up that it's only working with... yeah exactly, MySQL or MariaDB. So that's why I made this post, to encourage you to do some more tests with PostgreSQL and maybe, just maybe notice the same things as I did.
Disclaimer; I have not tested in clustered or bigger environments than 320 users.
@jospoortvliet Writing a blog post as we speak. Feel free to retweet or even post it on the Nextcloud blog if you don't feel it's to harsh or something like that. I'm also open for suggestions if you want me to improve it before you post it.
And here it is: https://www.techandme.se/we-migrated-to-postgresql/