一、OrientDB - Basic Concepts
1.1 图模型,关系模型和orientdb图模型的关系
- 表table,对应图模型的顶点V和边缘E
- Row行,对应顶点
- Column列,对应顶点和边的属性
- 关系,对应边
1.2 基本类型
- class,传统文档数据库模型,数据存在一种collection的形式中,orientdb遵循OPPS范例,class与关系型数据库中的table概念非常相似,但是又不模式,它可以是无模式,全模式或者混合的,并且可以继承,创建树,每个类都有自己的cluster或者clusters,默认会创建。
- cluster,存records,documents或者vertices的一个概念,一句话讲,就是一个存一组records的地方,默认情况下,一个类class会创建一个cluster,一个类class所有的records都存在同一个cluster中,有着相同的class名字,最多能创建2^15-1个cluster在database中。
- Relationships,有两种,一种为referenced,代表和目标的一种直接链接,embedded relationships意味着它在嵌入它的记录中存储关系,这种关系比较强。
- Database,访问实际数据的接口,例如queries, schemas, metadata, indices等。详细见Database types。
1.3 其他
- 记录的形式,可以为文档,Bytes,vertex,edge
- 记录id,Record id,自动分配的记录绝对位置的id
- Documents 灵活的一致记录形式
Vertex顶点
Edges边
二、orientdb客户端使用
- 2.1 链接服务端数据库
CONNECT remote:localhost root my_root_password
- 2.2 查看所有DATABASES
LIST DATABASES
- 2.3 创建DATABASES
CREATE DATABASE remote:localhost/GratefulDeadConcerts root ****
- 2.4 连接到特定的数据库
CONNECT remote:localhost/GratefulDeadConcerts admin admin
- 2.5 导入现有的database
IMPORT DATABASE /path/to/**db.gz
- 参考:
Running the OrientDB Console
https://orientdb.com/docs/last/Tutorial-Run-the-console.html
一些比较好的操作手册
- 1.OrientDB - Quick Guide
https://www.tutorialspoint.com/orientdb/orientdb_quick_guide.htm - 2.OrientDB Manual - version 3.0.11
http://orientdb.com/docs/3.0.x/ - 3.OrientDB教程
https://www.w3cschool.cn/orientdb/orientdb_installation.html