How to choose between connection pool and session pool?

154 Views Asked by At

I'm responsible for algorithm part using nebula-python, and there are a couple questions that confuse me a little bit, can you you help explain?

1.What is the difference between connection pool and session pool?

2.I mainly deal with CRUD graph databases (only for one space), where queries take up 90% of the scenario, which pool should I use in this case?

Thanks!

1

There are 1 best solutions below

0
Glenn On BEST ANSWER

Session pool is better, as it is a single instance of your backend service. The connection does not involve authentication, so the connection pool creates a session when it is used (one login authentication, if the web server has requests all the time, auth time will be available in each request. In the case of back-end online services, the recommended way is to use session pool if no space switch is involved.

In other cases, the connection pool is used to create a separate sessionon demand (remember to release the session after use).