Actions

System Administrator's Guide/PostgreSQL or MySQL?

From Mahara Wiki

< System Administrator's Guide
Revision as of 19:03, 27 March 2014 by Aaronw (talk | contribs) (Reverted edits by Luis paulo vieira (Talk) to last revision by WikiSysop)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The developers recommend PostgreSQL for maximum stability and data integrity. Properly tuned, PostgreSQL will likely outperform MySQL anyway - we are using InnoDB tables for the transaction support.

Furthermore, PostgreSQL can do DDL in transactions - that is to say BEGIN; CREATE TABLE foo(bar int); ROLLBACK; actually works how you would expect. This makes the upgrade process a lot safer, if the upgrade fails you know you won't have left your database schema in a mess that can't be automatically upgraded once the original problem is fixed.

We cannot say this enough - even if you have never used PostgreSQL before, if you have the option to use it, then use it. You will save yourself a lot of hassle when your site needs upgrading, and the system will be more stable. Everyone who has used MySQL seriously is aware that sometimes MySQL corrupts tables, and performs badly under high load. PostgreSQL has none of these problems.

Here is a forum thread with a detailed explanation of this recommendation, and examples of where using Postgres is advantageous for Mahara.