Hi I will try to keep on track but I've done a lot of research and now I just lost. I could really use some expertise here. Below is the situation:
Preface
This is a follow up question from my question here. The issue there was that my cypher queries were taking 1 second at the minimum to return a response. Even queries like RETURN 123 also took 1 second. Which lead to the conclusion Neo4j Bolt Driver for Python is slower than an actual http call to neo4j.
I can back this up with research from GitHub Issues and this from stackoverflow
The problem statement
Each time my code runs, it generates upto 10 Cypher queries and all those have to be fired and then operations need to be performed based on the results.
The issue is using
Boltthe queries take1 secondto execute and withHTTPI am stuck. Since I want to useQuery Parametersto make the query faster since now it's notBoltas eachhttpcall now takes30ms, multiply that by 10 {since I have 10 queries} and you have a very poor performing python API to fetch user relations. '
Where am I stuck
- A confirmation that yes, the
Boltdriver is slow and that I am not doing anything wrong. Since all the posts I've seen are dated a year back - My query has
ORandANDconditions, how can I write those using parameters inneo4jRESTCalls. - Is there some other
graphdatabase I should look towards? - Is there any way I can fire up to 10 queries and get a response time below
200ms?
Other reasons to think I am missing something:
- The legend has it,
neo4jis the most populargraph database. How is it possible with such drivers? - Over 1 year of reported issues with
BOLT driversand they still haven't fixed these issues.
Sample Request
curl -X POST \
http://localhost:7474/db/data/cypher \
-H 'Authorization: Basic bmVvNGo6Y29kZQ==' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"query" : "MATCH (ct:city)-[:CHILD_OF]->(st:state) WHERE (st.name_wr = {st}) AND (ct.name_wr= {ct}) RETURN st, ct",
"params":
{
"st" : "california",
"ct" : "san francisco"
}
}'
but what if I want to add a clause that either st should be California OR it can be Alaska AND ct must be san francisco, how do I do that with the parameters in REST
EDIT:
I replicated the script and below is the verdict:
58 transactions, tps 0.97 maxdelay 1.08
The curl sample request is the one that fire from postman. The code that I am using can be found from the linked question (in the preface).