简体   繁体   中英

What advantages does MongoDB offer over ElasticSearch as a NoSQL database only

I'm quite new to NoSql databases, but I'm really lovin' MongoDB with the official c# driver. It's currently the backend to an MVC application I'm writing, and the simplicity AND speed make my life way way easier.

However I've come to that point in the application where I need really great search. I used to use Solr, but have become quite interested in ElasticSearch.

ElasticSearch, as far as I can tell (from a very superficial level), can do everything MongoDB can in terms of being a document database.

So, if I'm already using a NoSql db, and I need great search, is there any point in Mongo? What's the use case?

Is Mongo faster? Easier to use? Is it the BSON datatypes and drivers? Why not use ElasticSearch as my DB?

I'm currently using AppHarbor and lovin' "The Cloud". I hate IT and want to focus on my application only. With that said, the only advantage I see so far is:

  • There are already a number of "Cloud" MongoDB providers. With ElasticSearch I've got to set it all up myself.

This is a very good question. I have asked myself the same question and came up with the following answer.

  1. ElasticSearch doesn't have a good way to backup data. As an example, do a quick search for “ElasticSearch backup” and one for “mongodb backup”. MongoDB has tools and documentation on how to backup data. While there is documentation on how to backup ElasticSearch data, this documentation doesn't seem as mature.
  2. In general, MongoDB has much better documentation. In particular its admin documentation is much better than ElasticSearch.
  3. MongoDB provides commercial support. You might not care about commercial support at the moment, but it is nice to know it is available.
  4. MongoDB has MapReduce built in, ElasticSearch does not. This may not be a big thing, but worth noting.

My personal opinion is that I wouldn't use ElasticSearch if you cannot afford to lose data. I could see using ElasticSearch as a primary data store for something requiring real-time analytics, but did not have any long-term data retention requirements. Otherwise, I would suggest using MongoDB and ElasticSearch together. There is a MongoDB River Plugin for ElasticSearch. This makes it pretty easy to update the ElasticSearch index automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM