I am connecting to NEO4J servers using py2neo by spawning parallel threads from my python client.
Approach 1 : Creating 1 connection per each thread. Works fine but it creates multiple parallel connection to server thereby increasing the total number of open connections.
Approach 2. : Create one connection only and then using the same in all thread while querying the server.
Wanted to understand which of the above approach is more efficient and would have lesser time complexity?
Initial thoughts : Approach 1 will take additional time of creating one connection for each thread and will also leave many open connections leading to load on server whereas approach 2 can solve this but will it then cause sync issues? Like since we have only one connection then multiple calls from multiple threads wont go in parallel. Is that the cases with py2neo connections?
py2neo version - 5.0b1 neo4j server : 4.x
Let me know if any additional details is required from my side.
Thanks for any help in advance.