我听到了更多关于 NoSQL 的消息,但还没有人给我一个关于如何使用它而不是关系数据库的清晰解释。
我读过它不能做 left joins
,所以我试图弄清楚如何使用这样的数据存储。来自阅读:Preserve Joins by code in MongoDB似乎建议只制作一张大 table ,就好像您已经在上面进行了连接一样。
如果上面的说法是正确的,那么我可以看到它可以如何使用。但是,我很好奇您将如何处理重复数据。作为规范化的概念,可以帮助您消除冗余并确保数据的一致性(例如,大写、空格等细微修改)...
我们是否只是为了可扩展的速度而牺牲数据的一致性,还是我遗漏了什么?
编辑
我一直在做更多的挖掘,发现以下问题的答案有助于澄清我的理解:
最佳答案
MongoDB 能够拥有包含其他文档数组的文档。这解决了许多在有理数据库中存在关系的情况。
当发票有多个位置时,您不会将这些位置放入单独的集合中。您可以将它们作为数组嵌入。
It makes me wonder about real life examples of when to use NoSQL versus when not to?
NULL
对于大多数产品。这两种解决方案都不是很优雅。但是 MongoDB 可以更好地解决这个问题,因为它允许集合中的每个文档具有一组不同的属性。By denormalizing the data, you should be able to solve all of the same problems that relational databases do... But there are rules on how to normalize data with relational databases. Are there rules that one can use to help them denormalize the data to use a NoSQL solution?
Any examples on when you might want to consider using both a NoSQL solution in parallel with a relational database?
https://stackoverflow.com/questions/19482459/
相关文章:
python - 有人知道 pymongo 中 2dsphere 索引的工作示例吗?
python - Mongodb复制集自动重新连接在nginx + uwsgi上下运行后无法正常工作
node.js - 是否可以将额外的参数传递给 Mongoose 更新回调
node.js - NodeJS ExpressJS PassportJS - 仅用于管理页面
mongodb - 在 mongo shell 中加载和运行聚合
c# - 使用 MongoDB 的 C# 驱动程序进行多字段查询
mongodb - 结合 Neo4J 和 MongoDB : Consistency
javascript - 在 MongoDB 更新语句中使用变量