arangodb/spring-data

How to insert a large amount of data with good performance?

xg-github-00 opened this issue · 2 comments

I tried using interface of saveAll to insert a large amount of data, but it was a bit slow. I saw the interface of insertDocuments function and I don't know if it can improve performance. Is there a specific example to show how to use it?Could you please give some advises?Thanks~

I would recommend using the underlying Java Driver directly, which is accessible via com.arangodb.springframework.core.ArangoOperations#driver().

You can then bulk insert documents with com.arangodb.ArangoCollection#insertDocuments(java.util.Collection<?>, com.arangodb.model.DocumentCreateOptions) and its overloaded variants.

See https://www.javadoc.io/static/com.arangodb/arangodb-java-driver/7.1.0/com/arangodb/ArangoCollection.html#insertDocuments(java.util.Collection,com.arangodb.model.DocumentCreateOptions)

I tried and it runs faster than before, thanks~ :-)