I’m new to Django and have only been using sqlite3 as a database engine in Django. Now one of the applications I’m working on is getting pretty big, both in terms of models’ complexity and requests/second.
How do database engines supported by Django compare in terms of performance? Any pitfalls in using any of them? And the last but not least, how easy is it to switch to another engine once you’ve used one for a while?
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.
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.