Skip to content

Commit

Permalink
Docs: Add warning about wrong Session usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorak-mmk committed Jan 23, 2024
1 parent ef17f3d commit 95330ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/connecting/connecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ other nodes in this cluster and connect to them as well.

## Best practices for using Session

:::{warning}
Always try to use only a single Session object per apllication because creating them is very expensive!
:::

The driver maintains its own pool of connections to each node and each connection is capable of handling multiple requests in parallel. Driver will also route requests to nodes / shards that actually own the data (unless the load balancing policy that you use doesn't support it).

For those reasons, we recommend using one instance of `Session` per application.
Expand Down

0 comments on commit 95330ed

Please sign in to comment.