[Django]-First time Django database SQL or NoSQL?

6👍

As a beginner, it will probably be easiest to learn Django using sqlite. You only need to provide a location for the database and to specify sqlite3 as your backend to get it working, which is nice. If you want to use postgres later, it’ll be more work but it’s still feasible. See @JonathanVanasco’s note in the comments.

If you want to eventually use a NoSQL DB, Django doesn’t support it currently. Here is the list of recognized 3rd party Django backends.

You could use Mongo through a third party fork known as django-nonrel, but this particular implementation doesn’t support ManyToManyFields and has a few other limitations. You can read more about Mongo in django-nonrel at this blog post. There’s some more unofficial documentation on django-nonrel here.

1👍

Postgres is a great database for Django in production. sqlite is amazing to develop with. You will be doing a lot of work to try to not use a RDBMS on your first Django site.

One of the greatest strengths of Django is the smooth full-stack integration, great docs, contrib apps, app ecosystem. Choosing Mongo, you lose a lot of this. GeoDjango also assumes SQL and really loves postgres/postgis above others – and GeoDjango is really awesome.

If you want to use Mongo, I might recommend that you start with something like bottle, flask, tornado, cyclone, or other that are less about the full-stack integration and less assuming about you using a certain ORM. The Django tutorial, for instance, assumes that you are using the ORM with a SQL DB.

0👍

sqlite is the simplest to start with. If you already know SQL toss a coin to choose between MySQL and Postgres for your first project!

0👍

According to their wiki, Django does not officially support NoSQL databases (a poor decision IMHO). So if you go the NoSQL route on Django, you’ll need to be comfortable dealing with non-standard forks of the project and errors that may not be well documented.

So for beginners on Django, SQL is an obvious choice.

That said, my first DB on Django was a NoSQL one, but I had used SQL databases on other platforms previously.

Leave a comment