TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The problem with MongoDB

2 点作者 sdomino超过 8 年前

1 comment

daliwali超过 8 年前
I don&#x27;t think that this is the solution to MongoDB problems mostly because they&#x27;re unsolvable. Here&#x27;s why:<p>- When you update across multiple documents, you&#x27;re not guaranteed that they all succeed or fail. This is why embedded documents is more consistent but less flexible: single document updates are atomic.<p>- When you make queries on multiple documents that depend on the previous query, the running query could be affected by updates that happen in between, otherwise known as lacking serializability. Again, this can be fixed by embedding documents.<p>- When you delete a document, there may be broken references to the deleted document. Unless you have denormalized the references to the deleted document, you must query the entire database to remove broken references.<p>If you go so far to emulate a relational database, you might as well just use one.