Neo4j数据库简介
Neo4j 是一个NoSQL的图形数据库(Graph Database)。Neo4j使用图(graph)相关的概念来描述数据模型,把数据保存为图中的节点以及节点之间的关系。很多应用中数据之间的关系,可以很直接地使用图中节点和关系的概念来建模。对于这样的应用,使用 Neo4j 来存储数据会非常的自然,要优于使用关系数据库。官方文档对Neo4j的介绍如下所示:
Neo4j is the world’s leading graph database. It is built from the ground up to be a graph database,
meaning that its architecture is designed for optimizing fast management, storage, and traversal of
nodes and relationships. Therefore, relationships are said to be first class citizens in Neo4j. An
operation known in the relational database world as a join exhibits performance which degrades
exponentially with the number of relationships. The corresponding action in Neo4j is performed as
navigation from one node to another; an operation whose performance is linear.
Neo4j分社区版(Community Edition)和企业版(Enterprise Edition),社区版本为免费版本。目前的最新版本为Neo4j 3.1。官方网址为https://neo4j.com/ Neo4j的相关文档URL地址如下
https://neo4j.com/docs/developer-manual/3.1/
https://neo4j.com/docs/operations-manual/3.1/
https://neo4j.com/docs/developer-manual/3.1/cypher/
System requirements
Neo4j的安装对硬件、系统等有一些要求,例如CPU、Memory、Disk、Filesystem、Software等
CPU
关于CPU,最低要求是Itel Core i3 推荐使用Intel Core i7 或 IBM POWER 8
Memory
关于Memory,最低要求是2GB, 推荐是16-32GB 或更多。 越大的内存允许处理越大的图,但必须正确配置,以免破垃圾收集坏性操作。
Disk
除了Disk的容量,Disk的性能对Neoj4的影响非常大,Neo4j的工作负载倾向于随机读。选择平均寻址时间低的存储,例如SSD
最低要求 10GB SATA
推荐配置 SSD w/SATA
FileSystem
最低要求 ext4(或类似的)
推荐配置 ext4、ZFS
Software
Java
必须安装OpenJDK 8 或 Oracle Java 8
Operation Sytem
Linux(Ubuntu, Debian) ,但是我的测试环境为Red Hat Enterprise Linux Server release 6.6,暂时还没有发现什么问题。
Architectures
X86 或 OpenPower(POWER8)
Neo4j安装步骤:
下面简单介绍Linux下Neo4j 3.1的安装步骤,安装测试环境为Red Hat Enterprise Linux Server release 6.6, Debian下安装具体参考文档,这里不做介绍。
1:下载Neo4j 3.1的安装包,去官方网址注册下载即可。选择特定的版本。下载地址 https://neo4j.com/download/
2:检查上面System Requirement,安装JDK 8
[root@gettestlnx03 ~]# rpm -qa | grep gcj
libgcj-devel-4.4.7-11.el6.x86_64
libgcj-4.4.7-11.el6.x86_64
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
[root@gettestlnx03 ~]# rpm -ivh /tmp/jdk-8u121-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk1.8.0_121 ########################################### [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
[root@gettestlnx03 ~]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
[root@gettestlnx03 ~]#