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

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

问题描述

我想确切地了解neo4j服务器和嵌入式模式的含义.甚至我都阅读过 Neo4j服务器与嵌入式的帖子.但是我并没有清楚地了解那些概念.我已经在作为neo4j服务器的Windows 64位计算机上安装了neo4j 2.1.1.那么什么时候neo4j嵌入式模式会出现呢?

I wanted to know exactly what is meant by neo4j server and the embedded mode. Even i gone through the post Neo4j Server vs. Embedded. But i dint get clearly those concepts. I have installed neo4j 2.1.1 on windows 64bit machine which is a neo4j server. So when neo4j embedded mode will come into picture?

我们又如何在嵌入式模式和服务器模式之间切换?

Also how can we switch between embedded mode to server mode or vice-versa?

当我使用mysql进行neo4j迁移时(使用批处理导入),在将节点和关系导入neo4j之后,在messages.log文件中获得一条消息,如下所示:

When i was working with mysql to neo4j migration(using batch-import), after importing the nodes and relationships into neo4j getting a message in a messages.log file as below:

Clean shutdown on BatchInserter(EmbeddedBatchInserter[C:\Users\Neo4j\t2.db]) 

如果我已经安装了neo4j服务器,那么嵌入在这里如何出现?因此,请澄清这些查询.

How embedded is appearing here if i have installed neo4j server ? So please clarify these queries.

谢谢

推荐答案

嵌入式数据库在您的应用程序内部运行,这意味着它们与您的应用程序位于同一JVM中.通常,对于嵌入式数据库,您将直接进行数据库访问或密码查询.这里有很多优点和缺点-缺点之一是您的JVM进程锁定了数据库;您不能在不同的JVM中有很多不同的应用程序同时访问同一嵌入式数据库.专业人士是直接访问.

Embedded databases run inside of your application, meaning they're in the same JVM as your application. In general, with embedded databases you'll do direct database access or cypher queries. There are a lot of pros and cons here - one of the cons is that your JVM process locks the database; you can't have a bunch of different applications in different JVMs accessing the same embedded database at the same time. The pro is direct access.

在运行服务器时,通常意味着您正在使用Web管理组件,该组件还提供了一组RESTful服务.这样做的好处是它在不同的JVM中.意味着您可以通过网络等从其他编程语言更轻松地访问它.您可能在许多JVM中拥有许多应用程序,它们都通过RESTful服务与服务器实例通信.通常,访问速度并不快,但更灵活.但是,当您以这种方式运行它时,将无法访问Java应用程序内部的图形(使用Neo4J API).

When you're running a server, usually that means you're using the web admin components which also provide a set of RESTful services. The pro of this is that it's in a different JVM. Meaning you could access it more easily from other programming languages, over the network, and so on. You could have many applications in many JVMs all talking to a server instance via RESTful services. Generally access isn't as fast, but it's more flexible. When you run it this way though, direct access to the graph inside of a java application (using the Neo4J API) is off limits.

如果要从嵌入式数据库中运行Web admin/GUI内容和RESTful服务,则可以执行此操作. 如何查看这些说明.

If you want to run the web admin/GUI stuff and RESTful services from within an embedded database, you can do that. See these instructions for how.

这是一个代码段:您需要的是WrappingNeoServerBootstrapper.

Here's a code snippet: what you need is the WrappingNeoServerBootstrapper.

AbstractGraphDatabase graphdb = getGraphDb();
WrappingNeoServerBootstrapper srv;
srv = new WrappingNeoServerBootstrapper( graphdb );
srv.start();
// The server is now running
// until we stop it:
srv.stop();

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

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