我一直在阅读有关 OrientDB 性能基准的帖子:http://technet.weblineindia.com/web/introduction-to-orientdb-a-nosql-dbms/ http://technet.weblineindia.com/web/introduction-to-orientdb-a-nosql-dbms/就是一个例子。
它表示“在普通硬件上每秒可以存储多达 150,000 条记录”
我可能做错了什么,但我无法在 orientDB 中尝试 UPSERT 来实现这种性能:
- Java API(检查顶点是否存在,如果不存在 - 创建一个) - 在大约 5 分钟内处理 20k 条记录的数据
- ETL 确实非常快地处理插入 - 20 秒内 19k 条记录 - 但 ETL 不支持 UPSERT
- 使用批量 OCommandScript 的最佳效果是通过 HASH INDEX 实现的 -
3.40 分钟 - 21,000 条记录 - SBTREE
2.46 分钟 - 21k 条记录 - 哈希索引
3 分钟 - 5000 条记录 - LUCENCE FULLTEXT INDEX
- 使用 HTTP POST - 和 JSON 5 分钟处理 21k 条记录
请问我缺少什么?有没有我不知道的更好的更新插入方法?
要创建/更新 Vertex 我的代码如下:
for (字符串键: keySet) {
iterator = graph.getVertices(keyName, key).iterator();
if (iterator.hasNext()) {
vertex = (OrientVertex) iterator.next();
} else {
vertex = graph.addVertex(className, attributeName, key);
count++;
}
vertexMap.put(key, vertex);
if ((count != 0) && (count % batch == 0)) {
System.out
.println("ModelDataUtils:: createVertexes:: Committing and re-opening the transaction");
graph.commit();
}
}
要添加边(如果不存在),代码如下:
if (!parentCardVertex
.getEdges(cardVertex, Direction.OUT)
.iterator().hasNext()) {
parentCardVertex.addEdge("Composedof",
cardVertex);
}
所有类的“Name”属性上都有 UNIQUE_HASH_INDEX。
此外,我还分析了,边创建比顶点创建花费的时间要多得多。