Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Separation of Logic: Search, Database, & Application

Separation of Logic: Search, Database, & Application

Problem

I'm trying to decide how I want to split up my logic.

I'm placing my main business logic in Node.js/Express, and I had been using Mongo for my database. This works great, but now I need to implement a really powerful search system, as search is one of the most important features of my site. At first I was very amazed at the lack of support and integration that Mongo and Couch offered, but then I realized I was trying to get a database to do something it wasn't made for.

Now I'm looking at using Solr or ElasticSearch, but its beginning to seem that these are capable of even doing some or most of the queries that Mongo can do, as long as I index my documents correctly (and by their nature, I will be indexing pretty much every property of every document). So that said, I'm thinking maybe I should just use something dead simple, like Redis, and rely on a powerful search tool like Solr/ElasticSearch instead.

Does this seem like a wise choice? Also, why are there no Nodejs modules for Solr, Lucene, or ElasticSearch?

Problem courtesy of: cjroth

Solution

MongoDB + Solr (or even better ElasticSearch) does sound like a reasonable choice for an app that has search as one of the most important features. MongoDB is not made for full text search, Solr (Lucene) is. And Solr is not meant to be a system of record (MongoDB is).

MongoDB vs Redis? Difficult to say without any requirements specified. I'd pick mongo at least for the sake of ad hoc queries. In any case, make sure you study the fantastic series of blog posts called jepsen by Kyle Kingsbury, both mongodb and redis were covered.

Solution courtesy of: milan

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Separation of Logic: Search, Database, & Application

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×