If you know nothing about databases I would strongly suggest Postgres as your first encounter. Where it does many things right, Mongo does many things weird and comes with pretty bad defaults making it a bad learning experience.
Postgres is tried and tested. It's also well supported and pretty easy to work with. You pretty much can't go wrong with Postgres as a first encounter with databases.
It's not even as simple as which of the two are better. They are built on entirely different concepts, so reading up on relational databases and NoSQL databases is going to be important.
I don't think that they are too different. It's mostly a question of normalization. In my opinion its more valuable and an easier transition to learn relational databases before document stores.
50
u/Prizephitah Jun 10 '16
If you know nothing about databases I would strongly suggest Postgres as your first encounter. Where it does many things right, Mongo does many things weird and comes with pretty bad defaults making it a bad learning experience.
Postgres is tried and tested. It's also well supported and pretty easy to work with. You pretty much can't go wrong with Postgres as a first encounter with databases.
Always use prepared statements!