Neo4j 服务器与嵌入式 [英] Neo4j Server vs. Embedded

查看:30
本文介绍了Neo4j 服务器与嵌入式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对什么是我的应用程序的最佳解决方案感到有些困惑.正如我目前所见,我必须在独立的 Neo4j(RestGraphDatabase)和 EmbeddedGraphDatabase(RemoteGraphDatabase 尚未用于生产)之间进行选择.

I'am a little bit confused about what is the best solution for my application. As I've seen so far, I have to choose between neo4j standalone (RestGraphDatabase) and an EmbeddedGraphDatabase (the RemoteGraphDatabase is not for production use yet).

优点 REST:

-> 不同的服务可以访问neo4j DB(示例:我有一个服务负责A、B和C类节点.第二个服务负责节点D和H,可以将D节点连接到A-节点).这样我就有了干净的域结构.每个服务只对自己的域节点负责.我可以更新每项服务,而不必关闭整个应用程序.

-> Different services can access the neo4j DB (sample: i have one service that is responsible for Nodes of kind A,B and C. The second service is responsible for nodes D and H and can connect D-nodes to A-nodes). In that way i have clean domain structures. Every service is only responsible for its own domain nodes. I can update each service and don't have to shutdown my whole application.

-> 我可以从不同语言 (PHP) 访问 neo4j 数据库

-> I can access the neo4j DB from different languages (PHP)

缺点:- 性能不如 EmbeddedGraphDatabase(因为 Neo4j 服务器和服务在同一台机器上,所以延迟不是那么大).- 没有交易

Cons: - Performance is not that good as an EmbeddedGraphDatabase (since the neo4j server and the services are on the same machine the latency is not that big). - No transactions

我的问题:这是使用独立服务器的好决定吗?或者我应该使用嵌入式服务并将服务混合成一个大服务?是否可以在没有事务支持的情况下运行大型(复杂)应用程序?

My questions: Is this a good decision to go with the standalone server? Or should I use the embedded one and mix up the services into a big one? Is it possible to run a big (complex) application without transaction support?

推荐答案

您说得对,REST 服务器的性能会降低.但是,您可以使用批处理操作与 REST 服务器进行交易;见 http://docs.neo4j.org/chunked/milestone/rest-api-batch-ops.html.您还可以构建特定于域的服务器插件,在服务器端执行您的事务逻辑:http://docs.neo4j.org/chunked/milestone/server-extending.html.

You're correct that performance with the REST server will be less. However, you can have something like transactions with the REST server using batch operations; see http://docs.neo4j.org/chunked/milestone/rest-api-batch-ops.html. You can also build domain specific server plugins that perform your transactional logic on the server side: http://docs.neo4j.org/chunked/milestone/server-extending.html.

如果您的架构要求您能够从多台客户端机器访问数据库,您唯一的选择是 REST 服务器或 Neo4j HA(高可用性).HA 仅适用于 Neo4j Enterprise 许可证.

If your architecture requires that you be able to access the database from multiple client machines, your only options are the REST server or Neo4j HA (High Availability). HA is only available with a Neo4j Enterprise license.

让应用程序架构告知使用了哪些工具,而不是相反.如果您已经确定您的应用程序最好作为单独的服务,不要仅仅为了支持底层持久性模型而将它们组合成一个.我对您的应用程序一无所知,但根据您的描述,我会选择 REST 服务器并使用批处理或服务器插件.

Let application architecture inform which tools are used, not the other way around. If you've already decided that your application is best as separate services, don't combine them into one just to support the underlying persistence model. I don't know anything about your application, but from your description, I would choose the REST server and utilize batches or server plugins.

这篇关于Neo4j 服务器与嵌入式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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