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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: When should i use a NoSql database

3 点作者 udswagz将近 10 年前
what scenario would warrant the use of a noSql database ?

6 条评论

Blackthorn将近 10 年前
Disclaimer: I&#x27;m an idiot and don&#x27;t make great architectural decisions.<p>The two main things to think about are simplicity and scale. As for the former, key-value stores from the basic BerkeleyDB (though I think there&#x27;s more modern and better software now) up to three-dimensional bigtables are really conceptually simple when it comes to your data. It&#x27;s (mostly) a blob, and it&#x27;s got a key. Couldn&#x27;t be easier. Of course, when it comes to using the data, once you want to add new uses it becomes harder because now you have to write actual code in a procedural language and that&#x27;s usually not very efficient. That&#x27;s where the power of relational databases comes in. Very very easy there to use the data in a new way you hadn&#x27;t envisioned easily. It&#x27;s just a matter of a different SQL query!<p>Then there&#x27;s scale. Most people don&#x27;t <i>really</i> have this problem. Think about the point where you want to stop using sqlite in favor of a separate-process database like Postgresql or MySQL. That&#x27;s a difficult spot to pinpoint, right? But you have a general idea of where it is. The time where you can&#x27;t scale postgresql out and start needing a lot of Cassandra or Accumulo servers is a good order of magnitude farther than that. It would really be premature optimization to worry about it before you know it&#x27;s going to be a problem. Especially since once you cross that bridge, you lose out on scale in a different dimension: querying and using the data becomes tougher!<p>I haven&#x27;t really talked about hierarchical schemaless structures like MongoDB because I don&#x27;t really like them &#x2F; don&#x27;t really think they&#x27;re that useful. Sorry!
trcollinson将近 10 年前
That is an exceptionally broad topic. NoSQL is a pretty large category of database that is pretty much anything that is not &quot;SQL&quot;. These include just about everything from document stores, object stores, caches, and columnar stores. So, it depends on what have in data.<p>Most people talk about Mongo when it comes to NoSQL. Mongo is a very nice, high availability, document store. It has eventual consistency and can be horizontally scaled in a number of ways. I won&#x27;t go into all of the uses but one I can think of is in an environment with very very high read with extremely low writes where you need low latency on reads and a document based data structure.<p>To answer this thoroughly would require quite a bit of time to build a curriculum around the various types of NoSQL stores, what their strengths and weaknesses are, and how to know whether your data fits. In other words, it&#x27;s a big topic.
Someone1234将近 10 年前
There are a lot of different kinds of NoSQL databases, and they have different usage scenarios.<p>For example a key&#x2F;value store like Cassandra is very different from a schemaless hierarchical structure found within MongoDB. They&#x27;re both NoSQL, but extremely different from one another.<p>I&#x27;d only suggest you study the different options so you&#x27;ll know if a specific NoSQL (or SQL) database solution is a good fit for your projects.
alfonsodev将近 10 年前
<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qI_g07C_Q5I" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qI_g07C_Q5I</a> In this video Martin Fowler have some recommendations of when to choose a relational, graph or noSql database.
nam1将近 10 年前
When you need more than one server to run your database.<p>The main different between NoSQL&#x2F;SQL DBMS is about auto scaling. NoSQL scales well on multiple servers, as they were designed to work that way, while SQL dbs do not.
评论 #9697245 未加载
romanovcode将近 10 年前
When the only option with SQL is EAV. Then you should use NoSQL.