NoSQL (MongoDB) vs Lucene (or Solr) as your database

前端 未结 10 1933
春和景丽
春和景丽 2020-11-28 17:05

With the NoSQL movement growing based on document-based databases, I\'ve looked at MongoDB lately. I have noticed a striking similarity with how to treat items as \"Documen

相关标签:
10条回答
  • 2020-11-28 17:41

    You can't partially update a document in solr. You have to re-post all of the fields in order to update a document.

    And performance matters. If you do not commit, your change to solr does not take effect, if you commit every time, performance suffers.

    There is no transaction in solr.

    As solr has these disadvantages, some times NoSQL is a better choice.

    UPDATE: Solr 4+ Started supporting commit and soft-commits. Refer to the latest document https://lucene.apache.org/solr/guide/8_5/

    0 讨论(0)
  • 2020-11-28 17:51

    @mauricio-scheffer mentioned Solr 4 - for those interested in that, LucidWorks is describing Solr 4 as "the NoSQL Search Server" and there's a video at http://www.lucidworks.com/webinar-solr-4-the-nosql-search-server/ where they go into detail on the NoSQL(ish) features. (The -ish is for their version of schemaless actually being a dynamic schema.)

    0 讨论(0)
  • 2020-11-28 17:51

    If you just want to store data using key-value format, Lucene is not recommended because its inverted index will waste too much disk spaces. And with the data saving in disk, its performance is much slower than NoSQL databases such as redis because redis save data in RAM. The most advantage for Lucene is it supports much of queries, so fuzzy queries can be supported.

    0 讨论(0)
  • 2020-11-28 17:54

    This is a great question, something I have pondered over quite a bit. I will summarize my lessons learned:

    1. You can easily use Lucene/Solr in lieu of MongoDB for pretty much all situations, but not vice versa. Grant Ingersoll's post sums it up here.

    2. MongoDB etc. seem to serve a purpose where there is no requirement of searching and/or faceting. It appears to be a simpler and arguably easier transition for programmers detoxing from the RDBMS world. Unless one's used to it Lucene & Solr have a steeper learning curve.

    3. There aren't many examples of using Lucene/Solr as a datastore, but Guardian has made some headway and summarize this in an excellent slide-deck, but they too are non-committal on totally jumping on Solr bandwagon and "investigating" combining Solr with CouchDB.

    4. Finally, I will offer our experience, unfortunately cannot reveal much about the business-case. We work on the scale of several TB of data, a near real-time application. After investigating various combinations, decided to stick with Solr. No regrets thus far (6-months & counting) and see no reason to switch to some other.

    Summary: if you do not have a search requirement, Mongo offers a simple & powerful approach. However if search is key to your offering, you are likely better off sticking to one tech (Solr/Lucene) and optimizing the heck out of it - fewer moving parts.

    My 2 cents, hope that helped.

    0 讨论(0)
提交回复
热议问题