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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

4 Reasons We Bet On MongoDB

2 点作者 firefox大约 11 年前

1 comment

lkrubner大约 11 年前
I think this is true:<p>&quot;For a technology startup with limited resources, broadly adopting a new DBMS means betting its own future on the DBMS. &quot;<p>It has become popular to attack MongoDB, but I think it is difficult to get an objective view of what people are doing with it. If you want to read a really scathing attack on MongoDB, consider this post:<p><a href="http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/" rel="nofollow">http:&#x2F;&#x2F;www.sarahmei.com&#x2F;blog&#x2F;2013&#x2F;11&#x2F;11&#x2F;why-you-should-never...</a><p>But I recall reading that essay and thinking &quot;These people don&#x27;t want a document store, they want a relational database&quot; and most of their criticism amounts to &quot;MongoDB is not a relational database.&quot;<p>In my experience, you have to love map&#x2F;reduce if you are going to have a positive experience with MongoDB. I mean this in the abstract sense: both your project and your mind need to be able to fit with that pattern of data flow that is called map&#x2F;reduce. I&#x27;m thinking of map&#x2F;reduce in broad terms: use a filter to get some data, use reduce to produce some aggregate.<p>I will here briefly mention a criticism I have of relational databases. Consider Wikipedia&#x27;s explanation of Edgar F. Codd&#x27;s life:<p><a href="http://en.wikipedia.org/wiki/Edgar_F._Codd" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Edgar_F._Codd</a><p>&quot;Codd&#x27;s theorem, a result proven in his seminal work on the relational model, equates the expressive power of relational algebra and relational calculus (which, in essence, is equivalent to first-order logic).&quot;<p>and Codd&#x27;s theorem:<p>&quot;The domain independent relational calculus queries are precisely those relational calculus queries that are invariant under choosing domains of values beyond those appearing in the database itself. That is, queries that may return different results for different domains are excluded. An example of such a forbidden query is the query &quot;select all tuples other than those occurring in relation R&quot;, where R is a relation in the database. Assuming different domains, i.e., sets of atomic data items from which tuples can be constructed, this query returns different results and thus is clearly not domain independent. Codd&#x27;s Theorem is notable since it establishes the equivalence of two syntactically quite dissimilar languages: relational algebra is an imperative, variable-free language, while relational calculus is a logical language with variables and quantification.&quot;<p>Clearly, this assumes that the relations among the data are known. I work mostly with early stage startups. The entrepreneurs I work with have no real idea about what relations they want establish among their data. They are an exploratory phase. I believe these entrepreneurs should be described as &quot;pre Codd&quot;. If you force them to specify relations among their data, you will get answers exactly as useful as these:<p><a href="http://blog.jimmyr.com/Funny_student_Exam_Answers_13_2008.php" rel="nofollow">http:&#x2F;&#x2F;blog.jimmyr.com&#x2F;Funny_student_Exam_Answers_13_2008.ph...</a><p>MongoDB is useful in this context. Start acquiring data. Don&#x27;t pretend you know what your schema is. You do not know what your schema is. The entrepreneur who perfectly understands what sort of data they want, and what the relations will be among the different sets of data, before the startup has launched, is a bit like Newton and Einstein: you can expect 1 such person every 200 years.