Hi, I'm using neo4j community and one of my usecases is to expose a search endpoint which accepts a list of queries which then are executed against neo4j. The number of queries varies but is usually in the 50-100 range sometimes a bit more but we can control this.
They all use the same cypher query but the parameter differs as I send each individual term.
Currently I do the following:
await asyncio.gather(*[search(t) for t in terms])
Where search has the following
await self.driver.execute_query(query, database_=self.database, term=term)
- Driver is reused
- Connected using bolt
For this particular usecase the performance of the code really degrades inside the asyncio.gather call. Running the same code but via the http api gives better results.
What is the best way to approach this problem. Can we execute multiple reads inside a single transaction? Would it make sense to chunk an incoming request with 50 items into 5 sessions doing 10 reads each?
Running a single search via http takes 8ms, bolt is at 21.