TinkerPop简述

ThinkerPop Apache 顶级项目

概述

TinkerPop是一个面向实时事务处理(OLAP)以及批量、分析型(OLTP)的开源的图计算框架。TinkerPop是一个可以应用于不同图形数据库的抽象层,避免应用程序与特定数据库高度依赖。

目标

提供通用的API和工具,使开发人员可以基于不同图数据库轻松创建图形应用程序,使图形数据库与图计算解耦,方便切换不同图形数据库,简化其工作。

体系结构

image

Gremlin

是TinkerPop图形遍历语言,使用户能够以简但的代码进行复杂的图形遍历,Gremlin具有“写一次,随处运行” 的特点。意味着,所有支持TinkerPop的图形系统都可以使用Gremlin语言进行图形遍历。

image

支持ThinkerPop框架的图形数据库

Amazon Neptune - Fully-managed graph database service.
Bitsy - A small, fast, embeddable, durable in-memory graph database.
Blazegraph - RDF graph database with OLTP support.
CosmosDB - Microsoft's distributed OLTP graph database.
ChronoGraph - A versioned graph database.
DSEGraph - DataStax graph database with OLTP and OLAP support.
GRAKN.AI - Distributed OLTP/OLAP knowledge graph system.
Hadoop (Spark) - OLAP graph processor using Spark.
HGraphDB - OLTP graph database running on Apache HBase.
IBM Graph - OLTP graph database as a service.
JanusGraph - Distributed OLTP and OLAP graph database with BerkeleyDB, Apache Cassandra and Apache HBase support.
JanusGraph (Amazon) - The Amazon DynamoDB Storage Backend for JanusGraph.
Neo4j- OLTP graph database (embedded and high availability).
neo4j-gremlin-bolt - OLTP graph database (using Bolt Protocol).
OrientDB - OLTP graph database
Apache S2Graph - OLTP graph database running on Apache HBase.
Sqlg - OLTP implementation on SQL databases.
Stardog - RDF graph database with OLTP and OLAP support.
TinkerGraph - In-memory OLTP and OLAP reference implementation.
Titan - Distributed OLTP and OLAP graph database with BerkeleyDB, Apache Cassandra and Apache HBase support.
Titan (Amazon) - The Amazon DynamoDB storage backend for Titan.
Titan (Tupl) - The Tupl storage backend for Titan.
Unipop - OLTP Elasticsearch and JDBC backed graph.

安装

最新版本号为:TinkerPop 3.3.3 (Released: 8-May-2018)

有两个版本:console、server
console:是一个单机的内存版本,可以进行学习测试。
server :是生产环境部署需要使用的版本。

以console版本为例:

$ unzip apache-tinkerpop-gremlin-console-3.3.3-bin.zip  
$ cd apache-tinkerpop-gremlin-console-3.3.3  
$ bin/gremlin.sh  
        \\,,,/  
         (o o)  
-----oOOo-(3)-oOOo-----  
plugin activated: tinkerpop.server  
plugin activated: tinkerpop.utilities  
plugin activated: tinkerpop.tinkergraph  
gremlin>

与Neo4j集成实例

注意:
除非与Neo Technology达成商业协议,否则Neo4j将获得AGPL许可 。该neo4j-gremlin模块是Apache2许可的,因为它只引用Apache2许可的Neo4j API。

Neo4j 2.x索引利用顶点标签来划分索引空间。TinkerPop3不提供用于为底层图形系统定义模式/索引的方法接口。因此,为了创建索引,直接调用Neo4j API非常重要。

要在Gremlin Server中托管Neo4j,必须先将neo4j依赖包“安装”或以其他方式复制到Gremlin Server路径。
自动执行此操作的方法是执行:

bin/gremlin-server.sh  
install org.apache.tinkerpop neo4j-gremlin 3.3.3

一旦安装,Gremlin服务器配置文件必须进行编辑以包含Neo4jGremlinPlugin如图所示conf/gremlin-server.neo4j。

gremlin> :install org.apache.tinkerpop neo4j-gremlin 3.3.3
==>Loaded: [org.apache.tinkerpop, neo4j-gremlin, 3.3.3] - restart the console to use [tinkerpop.neo4j]
gremlin> :q
...
gremlin> :plugin use tinkerpop.neo4j
==>tinkerpop.neo4j activated
gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]

ThinkerPop 与Spring Data的比较

image

posted @ 2018-11-22 12:55  长林-  阅读(8439)  评论(0编辑  收藏  举报