Poor performance of Dgraph for Sample case ? Check if implementation is wrong?

Looks Like getting and creating 50k nodes, not achievable in 1 sec with latest dgraph java.

Windows 16 GB RAM and Dgraph version v1.0.8

Server config

Sample JAVA code to reproduce

Writes :- 50k nodes in batch Took 15.16 mins
50k nodes one by one Took 72sec
Reads :- Getting 1 lac nodes one by one Took 2.17 mins

Help me with JAVA implementation to crack this in mili seconds, i may be implementing in wrong way.

Hey try doing your commits in batches of around 100 in each transaction instead of 3000.

It’s faster with smaller sets of json.


1 Like

Ok, That way i will achieve only creating nodes. But what about getting?


This is very fundamental problem for me, if anyone can help please.

Not sure what use case you are looking to solve by using graph database. You are querying 1 lakh nodes one at a time… When would you practically require to get these many nodes? Further, you execute term search but are not measuring exact dgraph responses (line 114 is only dgraph call for retreival)

So your timings include non dgraph processing.

What is your actual graph schema? What is your use case for graph processing? It’s not clear from the example…

It maybe you are applying relational thinking…

Hope that helps.


As we are revaluating dgraph, so we have just created test data to check performance. than we will plan the real case.

I have tried running 1lac query at once with single transaction that time was with in 1 min. while it was taking more time if try to do the same with dgraphClient.newTransaction() for each query. Just trying to know that why we need to create transaction for select queries.

I am just creating 1 lac nodes no relations. that create is taking around 15 mins.

1 Like

Any further help can be done?