OrientDB Performance

半城伤御伤魂 提交于 2019-12-22 09:51:51

问题


I have been reading posts about OrientDB performance benchmarks: http://technet.weblineindia.com/web/introduction-to-orientdb-a-nosql-dbms/ is one example.

It suggests "It can store upto 150,000 records per second on common hardware"

I might be doing something wrong, but i haven't been able to achieve this performance trying to UPSERT in orientDB:

  1. Java API (check if a vertex is present, if not - create one) - Processed data in around 5 minutes for 20k records
  2. ETL did process insert very quickly - 19k records in 20 seconds - but ETL doesn't support UPSERT
  3. using batches of OCommandScript the best was achieved with HASH INDEX - 3.40 minutes - 21k records - SBTREE 2.46 minutes - 21k records - HASH INDEX 3 minutes - 5k records - LUCENCE FULLTEXT INDEX
  4. USING a HTTP POST - & JSON 5 minutes for 21k records

What am i missing please? Is there a better way to upsert that I am not aware of ?

To create/update Vertex my code is as below : for (String key : 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();
        }
    }

To add an edge(if doesn't exist) the code is as below:

                        if (!parentCardVertex
                                .getEdges(cardVertex, Direction.OUT)
                                .iterator().hasNext()) {

                            parentCardVertex.addEdge("Composedof",
                                    cardVertex);
                        }

All classes have the UNIQUE_HASH_INDEX on the "Name" attribute. Also, I analysed, edge creation is taking significantly more time than vertex creation.

来源:https://stackoverflow.com/questions/33801952/orientdb-performance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!