问题描述
Solr支持更新,因此可以开发一个存储Solr中所有数据的Web应用程序。这是个好主意吗?
Solr supports updating, hence it is possible to develop a web app that stores all data within Solr. Is that a good idea?
只要使用Solr,用户就可以直接更新Solr文档。例如,用户可能编辑食谱文档以包含新标记。这种方法是好的,因为应用程序只有一个数据库。
Using just Solr, the user would update the Solr documents directly if they change something. For example, a user might edit a Recipe document to contain a new tag. This approach is good because the app simply has only one database.
使用两个数据库,用户会根据需要频繁更新数据库。然后,定期更新Solr索引。此方法允许您使用数据库技术来保持数据一致,并且不需要任何缓慢重建Solr索引。
Using two databases, the user updates the database as frequently as it needs to. Then, periodically the system updates the Solr index. This approach allows you to use the database technology to keep data consistent and doesn't require any slow rebuilding of Solr indexes.
对于我的特定应用程序,写入数据库
For my particular application, writes to the database will be infrequent.
哪种方法最有意义,会导致最稳定的系统?
Which approach makes the most sense and will lead to the most stable system?
推荐答案
如果数据库中的更新不频繁,则可以使用很容易,这是人们使用Solr的典型方式(即,不是其数据的主要存储)。还有一些人使用Solr作为他们的主要存储,但这是更不频繁,虽然当发布后,它包含了一些改进,使其更易于使用。
If your updates in the db are infrequent, then doing a nightly delta import with DIH is easy, and it's the typical way people use Solr (that is, not being the primary store for their data). There are some people that use Solr as their primary store too, but that is much more infrequent, though when 4.0 was released it contained some improvements that makes it easier to use it that way.
这篇关于Solr最佳实践:Solr中的所有数据或定期复制到Solr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!