Chr*_*ola 3 mysql mongodb node.js express mern
我已经学习了 udemy 上的几门课程NodeJS/Express,ReactJS/Redux有些课程是MERN STACK而且我真的很喜欢它们。但是讲师没有真正解释的唯一一件事是选择。在MongoDB学习这些课程之前,我总是使用 ifPostgreSQL或MariaBDfor all我的项目持久层。现在我刚刚MongoBD在所有这些课程中使用过,但不知道在哪种情况下它是最好的选择。所有的讲师都只是说,由于数据像 json json 数组一样存储,因此很容易解析为它自然地与Javascript任何其他项目兼容JSON format。我真的很想了解使用 Mongo 的技术原因,而relationnal database不是根据任何给定的项目要求而不是仅仅使用它,因为讲师这样做
小智 5
我曾在 SQL 和 MongoDB 方面工作过。
MongoDB
From my experience MongoDB is best suitable when you follow agile methodologies 
wherein you don't really know what your JSON object will have to contain.
SQL
SQL will be best suitable where JSON object is not going to be changed, like 
for bank projects, where you know the exact format of JSON which is never going 
to be changed.
差分法
Why I am saying this is, whenever we need to add some extra fields or need to 
link some fields with primary, foreign keys it would be pain and wouldn't know 
what could go wrong.
Wherein in MongoDB if you need to reference some field you will just need to 
add key ref with that field and you are done.
MongoDB
MongoDB would be great when one of your key from one JSON object is to be 
referenced to mutiple JSON object by just adding that field name in ref (ref: 
'user')
请投票这个答案,以便有需要的人找到这个答案,并了解 MongoDB 何时最适合他们。
| 归档时间: | 
 | 
| 查看次数: | 2208 次 | 
| 最近记录: |