cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How many sessions can have one drive

I have a node js project where one of DBs is neo4j. Currently there are three main function I do with neo4j create, update, delete. Since there are cases when I create 1 Million nodes or relationships I need to send them by chunks. So long I was creating and closing driver and session every time I was doing transaction. Now I want to understand when to open driver and when open session? When should I use reactive sessions? So far I found out , that dirve.close() should be implemented right before my server closes.
Form github I didn't understood what they mean by Create a reactive session to run Cypher statements in. I assume I will write cypher code anyway what is the difference reactive makse ?

1 ACCEPTED SOLUTION

Reactive is an more efficient use of resources esp. if you have many clients reading the data.

For you it might not make so much of a difference as the node API is already working with promises.

Yes you should only create the driver once and then close it when your app closes.

But you should create a new session for each new batch/block.
You can still attach multiple transactions to that session if you need to do multiple operations.

View solution in original post

1 REPLY 1

Reactive is an more efficient use of resources esp. if you have many clients reading the data.

For you it might not make so much of a difference as the node API is already working with promises.

Yes you should only create the driver once and then close it when your app closes.

But you should create a new session for each new batch/block.
You can still attach multiple transactions to that session if you need to do multiple operations.