3

I hear that Drupal can use not only MySQL but also Postgres, MariaDB, and MongoDB. (Please add here if it can use also some other database.)

Which of those databases have a great enough performance gain to justify switching? And how can I switch to the proposed database?

3
  • 1
    While core Drupal supports databases other that MySQL, this doesn't necessarily apply to non-core modules. I have run across some that use MySQL specific functions in queries.
    – mpdonadio
    Commented Sep 29, 2011 at 23:09
  • hmm.. I didn't know these. Normally they should pass through drupal API, I suppose. Which were these modules that you had problem with?
    – john
    Commented Sep 30, 2011 at 12:08
  • It's not an API thing, it is the actual SQL syntax. I don't recall any modules off the top of my head, though.
    – mpdonadio
    Commented Sep 30, 2011 at 12:48

2 Answers 2

7

Out of the box, Drupal supports MySQL (or an equivalent such as MariaDB), PostgreSQL and SQLite for its main database. With additional drivers it also supports Microsoft SQL server and Oracle Database.

The MongoDB module can be used to off-load storage of things like cached data, fields (ie. most data for content, user, taxonomy terms, etc.) and sessions data from the main database to MongoDB. But MongoDB alone can not be used, you still need a SQL database. See NoSQL vs Other SQL Drupal Setups and its accepted answer for more information.

I'm not an expert, but except for SQLite, I'm not sure switching DB engine is a good way to get great performance gain. I guess each engine has its strengths and its own optimization tools. I guess great performance gains can be obtained in each of them, but you have to knows how to do it.

There are also others performance aspects to consider, such as caching layers (Varnish, Memcache, APC, etc.), clustering and Content Delivery Network for static files.

1
  • Thanks for clarifying about mongodb. I have considered the other aspects and tried to optimize accordinly, but the question remains what is the fastest database to use. Mysql and mariadb are exactly the same, except their licencing? Postgress is faster or not than mysql?
    – john
    Commented Sep 29, 2011 at 8:14
3

I don't think performance is a reason to use another database than MySQL/MariaDB. A typical reason for sqlite would be simplicity (runs within PHP, no external service required), a typical reason for prefering PostgreSQL/SQL Server/Oracle would be that you are already using it and have existing know-how and infrastructure for it.

There are many alternative ways to improve the performance, for example using a different cache backend (to get a large part of the load away from the database), optimizing your database (there is enough to find on this site and google about this topic), setting up slave servers to distribute the load across multiple servers and more.

That said, Drupal 7 works perfectly fine on PostgreSQL, Sqlite and I think it also runs well on SQL Server (although you might run into issues with contrib modules), no idea about Oracle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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