MongoDB 是关系数据库的有效替代品吗?卢森?

发布于 2024-08-26 23:15:11 字数 1431 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

遇到 2024-09-02 23:15:11

从技术上讲,您可以使用 MongoDB 进行全文搜索,但您会错过全文搜索提供商提供的很多功能。我喜欢 MongoDB,但如果实施时间是一个问题的话,我会将其与全文搜索提供程序(例如 Lucene 或 Sphinx)结合使用。我认为 MongoDB 索引单词数组的便捷能力最好留给标记和基于标记的搜索,而不是全文搜索。

搜索(信息检索)不仅仅是获取任何匹配的文档,如果您希望搜索结果具有任何相关性,您将需要类似于 TF-IDF、短语匹配(序列中的单词)的内容得分更高)或任何其他 IR 技术来提高搜索精度。如果您使用 MongoDB,您将需要从头开始实现它。

如果您真的想从头开始实现这一切,但又不想理会原始存储方面的问题,MongoDB 非常接近您可以在其上实现的最佳数据库存储(无法想到其他许多存储),但是仍然不是一个很好的选择。

Technically you can do full text search with MongoDB, but you're missing out on a lot that a full text search provider has to offer. I love MongoDB, but I'd couple it with a full text search provider (such as Lucene or Sphinx) if time to implementation is at all a concern. I think MongoDB's convenient ability to index word arrays is better left to tagging and searching based on tagging than full text search.

Search (Information Retrieval) isn't just about grabbing any documents that match, if you want your search results to have any relevance at all you're going to need something along the lines of TF-IDF, phrase matching (words in a sequence score higher) or any number of other IR techniques to improve search precision. If you use MongoDB you'll need to implement it all from scratch.

If you really want to implement it all from scratch but not bother with the raw storage side of things, MongoDB is pretty close to the best DB store that you could implement it on top of (can't think of many others), but that still doesn't make it a great option.

奶茶白久 2024-09-02 23:15:11

CouchDb 似乎是一个(其他)可能的替代 通过以下方式使用 Lucene
couchdb-lucene 项目。

CouchDb seems to be a(n other) possible alternative to use Lucene via
couchdb-lucene project.

荭秂 2024-09-02 23:15:11

MongoDb 是一个 NOSQl,Lucene 和 SOLR 是搜索引擎,比较中添加的另一件事是像 Terracota 和 EhCache 这样的缓存。都有自己的目的。

如果需要使用词干搜索和全文搜索,则相关性设置(例如显示产品标题排名中的文本匹配的结果多于描述中的文本匹配)以及许多此类基于文本的功能。还有排名、相关性、声音相似、部分单词匹配等。所有这些事情最好由基于搜索的存储系统(例如 SOLR 和 Lucene)处理。

如果您的标准只是更快速的检索,并且不需要持久的表示数据对象,那么只需使用类似 Terracota 的缓存即可。

如果您需要更快的检索速度,还需要在一个数据源中协作和聚合数据,并且还需要聚合的数据持久,那么请使用像 Mongodb 这样的 NOSQL。

MongoDb is an NOSQl, Lucene and SOLR are search engines, and adding another thing to the comparison is caches like Terracota along with EhCache. All have thier own purpose.

If searching along with full text search is required with stemming, relevancy settings like showing results with text matching in product title ranking more than text matching in desctription, and many such text based features. Also ranking, relevancy, sound alike macthing, partial word matching etc etc . All this things are best handled by search based storage systems like SOLR and Lucene.

If your criteria is fater retrieval only and you dont need your presentation data objects to be durable then simply use a cache lke Terracota.

If you need faster retrieval and also need to colloborate and aggregate data in one datasource and also need that aggregated data to be durable then use NOSQL like Mongodb.

無心 2024-09-02 23:15:11

但速度较慢(参见此处

  • 看起来是可能的, 你必须自己进行分词和词干处理。
  • 查询排名“需要用户提供代码才能执行此操作”

Look's possible but slower (see here)

  • You will have to do word splitting and stemming your self.
  • Ranking of queries 'requires user supplied code to do so'
神经大条 2024-09-02 23:15:11

我对 MongoDB 不熟悉,所以我不能直接回答这个问题,但我想指出的是,与 Lucene(大约有十年历史)和关系数据库(已经存在了几十年)不同,MongoDB 还不到三年老的。

在游戏的这个阶段,它可能仍处于成熟阶段。它可能适合您的需求(我很好奇是否有熟悉使用它的人会在这里插话),但您需要将其纳入您的方程式中。您愿意付出代价来使用尖端技术吗?

即使它最终足够稳定和高效,您也可能会遇到网站/教程等形式的有限支持的问题(由于用户群较小)。您还冒着它被终止的风险。

抓住这个机会是值得的,但你需要睁大眼睛,不要被“哦,看看闪亮的新玩具”效果蒙蔽了双眼。

I'm not familiar with MongoDB so I can't directly answer the question but I would like to note that unlike Lucene (which is about ten years old) and relational databases (which have been around for decades) MongoDB is less than three years old.

At this stage of the game it is likely still maturing. It may be suitable to your needs (and I'm curious to see if anyone familiar with using it will chime in here) but you'll need to factor this into your equation. Are you willing to pay the price to use cutting edge technology?

Even if it winds up being stable and efficient enough, you may run into issues with limited support in the form of websites/tutorials etc. (due to the small user base). You are also taking the chance that it will be discontinued.

It can be worthwhile to take this chance, but you need to do so with your eyes open and not blinded by the "oh, look at the shiny new toy" effect.

和我恋爱吧 2024-09-02 23:15:11

另一种选择是使用 elasticsearch (以 lucene 为支持)宽度 couchdb: http://www.elasticsearch.org/blog/2010/09/28/the_river_searchable_couchdb.html

灯下孤影 2024-09-02 23:15:11

Lucene 是一个成熟且稳定的产品。可惜 MongoDB 的情况还不是这样。所以我认为 Lucene 加上 RDBMS 是一个风险较小的选择。

当然,在某种程度上这取决于项目的性质:“非常重要(而且很大)”到底有多重要?另一件事是,您以前有 MongoDB 的经验吗(我猜没有)?如果您能够接触到具有一定专业知识的人,那么这将降低风险。

Lucene is an established and stable product. Alas the same is not yet true of MongoDB. So I would think that Lucene plus an RDBMS is a much less risky option.

Of course, to a certain extent it depends on the nature of the project: just how important is "very important (and big)"? The other thing is, do you have prior experience of MongoDB (I'm guessing not)? If you can get access to people who have some expertise then that would mitigate the risk.

百合的盛世恋 2024-09-02 23:15:11

在参加 Devoxx 2011 并参加 10Gen 的演讲后,我写了一篇比较 MongoDB 和 RDBMS 数据库的小博客。 MongoDB是目前流行的Nosql数据库之一。正如之前的回复中所说,MongoDB是NoSQL数据库,与现有的主流rdbms数据库不同。

http://blog.iprofs.nl/2011/11/25/is-mongodb-a-good-alternative-to-rdbms-databases-like-oracle-and-mysql

After attending Devoxx 2011 and attending a presentation from 10Gen, I have written a little blog comparing MongoDB to RDBMS databases. MongoDB is one of the popular Nosql dbs.As stated in the replies before MongoDB is a NoSQL db, which is different to the exising mainstream rdbms databases.

http://blog.iprofs.nl/2011/11/25/is-mongodb-a-good-alternative-to-rdbms-databases-like-oracle-and-mysql

ㄖ落Θ余辉 2024-09-02 23:15:11

对于全文搜索解决方案,我使用了 Lucene & Sphinx 较早,但它们并不能很好地为所提供的关键字获取最佳结果。所以我使用了mongodb全文搜索插件MongoLantern,这个插件非常擅长。而且在性能方面它使用MongoDB作为后端引擎,所以根本不存在性能问题。等待有关 MongoLantern 生产可用性的更多评论。

https://sourceforge.net/projects/mongolantern/

For fulltext search solutions, I have used Lucene & Sphinx earlier but they are not that good to fetch best results to the supplied keyword. So I used mongodb fulltext search plugin MongoLantern, which is very good at it. Moreover in terms of performance it's using MongoDB as a backend engine, so there is no performance issues at all. waiting for more reviews in terms of Production usability of MongoLantern.

https://sourceforge.net/projects/mongolantern/

千紇 2024-09-02 23:15:11

不,不是,因为 MongoDB 不是关系型的。

No, it isn't, since MongoDB is not relational.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文