Question

I need your advice. I'm building a simple app for furniture warehouse using NodeJS + Mongodb. For database I would like to use MongoDB for it's simplicity, but while building the app I've realized that it is not that easy to perform search within database.

You need to create a text index in order to search on keywords. Since new data will be added constantly, every time it needs to update the index. Will it decrease performance of db?

Moreover is it a good choice for storing such things? It will be contain fields like: item, number, description, data in, date out. I just didn't really want to deal with SQL and wanted to try something new and simple, but so far I stuck on search feature...

Thanks for any advices.

Was it helpful?

Solution

Indexes need to be updated every time you insert a document into the database - that's true regardless of index type (normal or text) and for that matter true for other databases too. It's also true for text search engines like Solr or Elasticsearch. Without knowing the size of your data set, the frequency of inserts and updates, size of the server you are running on, etc it's hard to give you a solid recommendation.

You can always start with MongoDB's text search feature and then if you outgrow it (due to size of the data or specific features required) index the data into Elasticsearch for better performance text queries.

OTHER TIPS

what about Map Reduce feature in mongodb?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top