OrientDB

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(SQL)
(对象模型)
第38行: 第38行:
 
*使用 Java 反射(Reflection) 注册类并且使用 [http://www.jboss.org/javassist Javassist Proxy] 管理 Object-to-Document 转换。  
 
*使用 Java 反射(Reflection) 注册类并且使用 [http://www.jboss.org/javassist Javassist Proxy] 管理 Object-to-Document 转换。  
 
*[http://orientdb.com/docs/last/Object-Database.html Object API] [http://orientdb.com/docs/last/Object-2-Record-Java-Binding.html Object Binding] [http://orientdb.com/docs/last/Java-Schema-Api.html Schema API]
 
*[http://orientdb.com/docs/last/Object-Database.html Object API] [http://orientdb.com/docs/last/Object-2-Record-Java-Binding.html Object Binding] [http://orientdb.com/docs/last/Java-Schema-Api.html Schema API]
 
  
 
{| class="wikitable"
 
{| class="wikitable"
第62行: 第61行:
 
| Link
 
| Link
 
|}
 
|}
 +
一个简单的用户表
 +
create class user extends V
 +
create property user.image Binary
 +
create property user.name string
  
 
==键/值模型==
 
==键/值模型==

2016年5月20日 (五) 06:23的版本

OrientDB-90x90.gif

OrientDB 是一个Java开发的开源(Apache v2)NoSQL文档图形数据库,也通过 OrientDB SQL 支持 SQL

目录

安装

下载二进制或编译源码

$ git clone https://github.com/orientechnologies/orientdb
$ git checkout develop
$ cd orientdb
$ mvn clean install -DskipTests
$ ls -l distribution/target/

指南

./console.sh

orientdb> CONNECT PLOCAL:../databases/GratefulDeadConcerts admin admin 或 
orientdb> CONNECT REMOTE:127.0.0.1/GratefulDeadConcerts admin admin
orientdb {db=GratefulDeadConcerts}> list classes
orientdb {db=GratefulDeadConcerts}> select from ouser
orientdb {db=GratefulDeadConcerts}> info class ouser
orientdb {db=GratefulDeadConcerts}> select expand(classes) from metadata:schema
http://localhost:2480/ // OrientDB Studio, 若:OrientTokenHandler: true, enabled后,此帐号将无法登录 
root/orientdb
http://localhost:2491 // OrientDB Workbench, 设置Server, 端口:2480
admin/admin

SQL

OrientDB数据库有四种记录(record)类型:

  • Document, JSON格式
  • RecordBytes, BLOB二进制
  • Vertex
  • Edge

每当生成一条记录(record), 系统会自动分配一个唯一的标识:Record ID 或 RID,格式:#<cluster>:<position>

对象模型

在 OrientDB 里,一个类(class)定义记录(record)的类型(type),ObjectDatabase 让 Java Objects (POJO classes) 到 文档 Records 的转换和绑定更透明、更简单。

Relational Model Object Model OrientDB Object Model
Table Class Class or Cluster
Row Object Document or Vertex
Column Object property Document field or Vertex/Edge property
Relationship Pointer Link

一个简单的用户表

create class user extends V
create property user.image Binary
create property user.name string

键/值模型

Relational Model Key/Value Model OrientDB Key/Value Model
Table Bucket Class or Cluster
Row Key/Value pair Document
Column not available Document field or Vertex/Edge property
Relationship not available Link

文档模型

Relational Model Document Mode OrientDB Document Model
Table Collection Class or Cluster
Row Document Document
Column Key/value pair Document field
Relationship not available Link

图模型

Relational Model Graph Model OrientDB Graph Model
Table Vertex and Edge Class Class that extends "V" (for Vertex) and "E" (for Edges)
Row Vertex Vertex
Column Vertex and Edge property Vertex and Edge property
Relationship Edge Edge

对比

驱动

通过三种方式支持不同的语言驱动程序

  • Native binary remote, 使用 binary protocol
  • HTTP REST/JSON, 使用 HTTP protocol
  • Java wrapped

一些语言驱动程序

图书

用户

图集

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱