热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

逻辑的分离:搜索、数据库和应用-SeparationofLogic:Search,Database,&Application

ImtryingtodecidehowIwanttosplitupmylogic.我正试图决定我该如何打破我的逻辑。Implacingmymainbusines

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.

我把我的主要业务逻辑放在Node。js/Express,我一直在使用Mongo作为我的数据库。这很有用,但是现在我需要实现一个非常强大的搜索系统,因为搜索是我的站点最重要的特性之一。起初我对Mongo和Couch提供的支持和集成的缺乏感到惊讶,但后来我意识到我想要一个数据库来做一些不是为它而做的事情。

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.

现在我看着使用Solr或ElasticSearch,但是它开始看起来,这些甚至有能力做一些或大部分查询Mongo能做的,只要我索引文件正确(从本质上说,我将每个文档的索引几乎所有属性)。所以说,我在想也许我应该用一些简单的东西,比如Redis,然后依靠一个强大的搜索工具,比如Solr/弹性搜索。

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

这看起来是个明智的选择吗?另外,为什么没有Solr、Lucene或ElasticSearch的Nodejs模块呢?

1 个解决方案

#1


4  

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 + Solr(或者更好的弹性搜索)听起来确实是一个合理的选择,因为搜索是最重要的功能之一。MongoDB不是用于全文搜索的,Solr (Lucene)是。Solr并不是一个记录系统(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.

MongoDB vs复述,?很难说没有任何规定。我选择mongo至少是为了特别的查询。无论如何,确保你研究了凯尔·金斯伯里(Kyle Kingsbury)的《杰普森》(jepsen)这一系列精彩的博客文章,包括mongodb和redis。


推荐阅读
author-avatar
荣清右
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有