Which database engine to choose for Django app? [closed]

If you are going to use a relational database, the most popular in the Django community seems to be PostgreSQL. It’s my personal favorite. But, MongoDB seems to be getting pretty popular in the Python/Django community as well (I have never done a project with it, though). There are a lot of successful projects out there on MySQL as well. But, I personally prefer PostgreSQL 9.0 or 9.1. Hope this helps.

EDIT: I didn’t do that great of a job with this post. Just want to add a couple of more considerations.

For the vast majority of websites, either MySQL or PostgreSQL will work fine. Both have their strengths and weaknesses. I suggest you google “MySQL vs. PostgreSQL” There are a lot of hits for this search (at the time writing this, I get over 3,000,000). Here are a few tips in doing your evaluation.

  1. Give strong preference to more recent articles. Try to make sure you are comparing MySQL 5.5 to PostgreSQL 9.0 or 9.1.
  2. MySQL let’s you choose your storage engine. IMO, the closes Apple to Apples comparison is InnoDB to Postgres.
  3. Keep in mind that you may not need all of the features of InnoDB or Postgres. You should also look at some of the other Storage engines.

Also, if you plan on using any triggers in your system, there a couple of really nasty bugs with MySQL and InnoDB related to them and ACID compliance. Here’s the first one and here is another one. You may not need this functionality, just be aware of it.

One last thing that might make a difference to you is that with PostgreSQL you can write db functions with Python. Here is a link to the docs for this.

Leave a Comment