Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL vs PostgreSQL? Which should I choose for my Django project?

My Django project is going to be backed by a large database with several hundred thousand entries, and will need to support searching (I'll probably end up using djangosearch or a similar project.)

Which database backend is best suited to my project and why? Can you recommend any good resources for further reading?

like image 584
rmh Avatar asked Feb 25 '09 10:02

rmh


People also ask

Which database should I use with Django?

By default, the configuration uses SQLite. If you're new to databases, or you're just interested in trying Django, this is the easiest choice. SQLite is included in Python, so you won't need to install anything else to support your database.

Should I choose PostgreSQL or MySQL?

In general, PostgreSQL is best suited for systems that require execution of complex queries, or data warehousing and data analysis. MySQL is the first choice for those web-based projects which require a database merely for data transactions and not anything intricate.

Can I use PostgreSQL with Django?

Setting up PostgreSQL in DjangoTo get Python working with Postgres, you will need to install the “psycopg2” module. Now, go to the below link and download and set up PostgreSQL. create a database name gfg in your Postgres server. Now its time to switch from SQLite to PostgreSQL.

Can MySQL be used with Django?

Django supports MySQL 5.7 and higher.


1 Answers

For whatever it's worth the the creators of Django recommend PostgreSQL.

If you're not tied to any legacy system and have the freedom to choose a database back-end, we recommend PostgreSQL, which achives a fine balance between cost, features, speed and stability. (The Definitive Guide to Django, p. 15)

like image 72
oivvio Avatar answered Sep 24 '22 14:09

oivvio