一起使用 MongoDB 和 Neo4j [英] Using MongoDB and Neo4j together

查看:65
本文介绍了一起使用 MongoDB 和 Neo4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始一个新项目,我正在考虑使用 MongoDB 作为文档存储设施,并使用 Neo4j 作为映射文档之间关系的机制,然后我想通过 rest API 公开我的查询结果.有人会说这样做的优点和缺点是什么?有没有更好的方法可以使用不同的 NoSQL 文档存储来实现这一点?有没有可以在网上找到有人尝试做类似事情的例子?

I am starting a new project and I am looking at using MongoDB as the document storage facility and Neo4j as the mechanism to map relationships between documents and then I want to expose the results of my queries via rest API. What would one say are the advantages and disadvantages of doing it this manner? Are there any better ways of achieving this perhaps using a different NoSQL document store? Are there any examples one could find online where someone has tried to do something similar?

推荐答案

我一直在考虑将这两个一起使用,因为我的数据已经在 mongodb 中.但我不想在现有架构的基础上再添加一个数据库顶部,因为添加 neo4j 将需要更多资源,例如内存、磁盘空间,更不用说花费在维护 2 个数据库上的时间了.

I have been thinking about using these two together for a while because my data is already in mongodb. But I don't want to add one more DB top of the existing architecture, because addition of neo4j will require more resources e.g. memory, diskspace and not to mention time invested in maintaining 2 DBs.

我能想到的另一个问题是,当您使用 mongodb 对数据进行分片时,您还必须管理 neo4j 数据 w.r.t.这些新碎片.Neo4j 中的扩展是通过集群完成的,它是商业版企业版的一部分.

Another problem which I can think of is when you shard your data with mongodb, you'll also have to manage your neo4j data w.r.t. these new shards. Scaling in neo4j is done through clusters and it is a part of enterprise edition which is commercial.

我做了进一步的研究,发现 OrientDB 可以将数据存储为文档及其图形数据库.

I did further research and found out that OrientDB can store the data as documents and its a graph db.

另一种方法是在 MongoDB 本身中构建关系,并在此基础上编写逻辑并通过 REST API 公开此逻辑.

Another way is building the relationships in MongoDB itself and write your logic on top of that and expose this logic through a REST API.

这篇关于一起使用 MongoDB 和 Neo4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆