MySQL、MongoDB 和 Solr
我对 NoSQL 数据库不太熟悉,也不太了解它们的潜力,而且我还在学习中。同时,我需要开发具有搜索功能的简单应用程序。
我读过一些关于 Solr、MongoDB 以及它们的组合的文章。但是,我必须创建的应用程序应该包含许多“标准”内容(例如组合框,应该从数据库填充)。此外,还有元数据和其他附加信息的字段。
我想到的想法是开发 MySQL 数据库来保存关系数据(如元数据、组合框值、注释...)。对于每条记录,我可以生成应转发到 Solr 的 ID,以及应建立索引的文档。 Solr 将进行索引,并且具有指定 ID 的文档可以存储在 MongoDB 中。
可能有一种更简单的方法,我想听听:)这并不难,但我不确定这是最好的方法。最终,应用程序应该相当简单:用户应该选择几个预定义字段,输入更多字段并上传文档(或其中几个)。如果有人可以建议更好的架构,我将不胜感激。
最好的
I'm not so familiar with NoSQL databases, and I'm not quite aware of their potential, and I'm still learning. In meantime, I need to develop simple application with search capabilities.
I've read a few posts about Solr, MongoDB and combination of these. But, the application I have to create, should include many "standard" things (like Combo boxes, which should be populated from database). Also, there are fields for metadata, and other additional info.
The idea I thought about is to develop MySQL database which will keep relational data (like metadata, combobox values, notes...). For every record, I could generate ID which should be forwarded to Solr, together with document which should be indexed. Solr will do indexing, and that document, with assigned ID could be stored in MongoDB.
Probably there is an easier way, and I would like to hear that :) this is not that hard, but I'm not sure that is the best way. At the end of the day, application should be fairly simple: user should choose few predefined fields, enter few more fields and upload a document (or few of them). If someone could suggest better architecture, please, I would appreciate an advice.
Best
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将从文档结构开始。
我听起来 mongodb 非常适合您想要存储的数据,因为您可以将所有与组合框数据相关的内容保留在 mongodb 上的单个文档中,这将非常自然。在 mysql 中,对于所有引用的内容(例如注释、值),您可能会使用单独的表。
这是 mongodb 中潜在模式的示例:
如果您的应用程序应该具有全文搜索,您可以在每次更新/插入时存储信息两次。第一个在 mongodb 中,第二个在 solr 中。同样,您可以拥有需要向最终用户显示的文档(它通常不包含数据库中包含文档的所有信息):
solr 文档:
Solr 文档 _id 对应于 mongodb 文档 _id。
所以:
一般来说,我在你的应用程序中没有看到 mongodb、mysql 和 solr 在一起。
我只看到两个合理的组合:
I'll start from document structure.
I sounds like mongodb very good fit for data you want to store, because you can keep all related to combobox data within single document on mongodb and it will be very naturally. In mysql for all referenced things like notes, values you will probably use separate tables.
This is an example of potential schema in mongodb:
If your app should have full text search you can store information twice on each update/insert. First in mongodb and second in solr. Also in sort you can have document that you need to display to the end user (it usually not contains all information that contains document in a database):
solr document:
Solr document _id correspondent to mongodb document _id.
So:
And in general i don't see in your application place for mongodb, mysql and solr together.
I see only two reasonable combinations: