I have to make a website. I have the choice between Postgres and MongoDB.
Case 1 : Postgres
- Each page has one table and each table has only one row, for one page (each page is not structured like another)
- I have a timelined page with medias (albums and videos)
- So I have multiple medias (pictures, videos), and I display it as well by an album of pictures page and a videos page.
- Therefore I have a medias table, linked with an album table (many-to-many), and a type column for determining if it's picture or video.
Case 2 : MongoDB
- I'm completely new to NoSQL and I don't know how to store the data.
Problems that I see
- Only one row for a table, that disturb me
- In the medias table, I can have an album with videos, I'd like to avoid it. But if I cut this table in pictures table and videos table, How can I do a single call to have all the medias for the timelined page.
That's why I think it's better to me to make the website with MongoDB.
What is the best solution, Postgres or MongoDB? What do I need to know if it's MongoDB? Or maybe something escape me for Postgres.
jsonandjsonbdata types, operators and index support. It's pretty good for hybrid data storage. But in the end, use what works for you. I advise you not to approach it with a model of creating lots of tables, with one row per table, that'll be clumsy and perform terribly.