I am creating a tool that lets a user do CRUD operations on a Cassandra DB through a graphical user interface. I was first planning to have clients establish their own connection to the cluster and get a session each but after doing research everyone is saying that you should use only one session. Right now I have two solutions:
1. Use multiple sessions anyways, as I had planned first.
2. Use a client-server connection and send CQL queries to the server to then send to the DB and then return results to the client.
3. A third solution I haven't thought/know about.
As an example lets say we have 10 clients working at the same time (I doubt there will be this many working on it at the same time) and because I am curious, consider if there was 100 clients at the same time.
I am really leaning towards solution 1. but I also really want a second opinion from someone experienced. So yeah, is it ok for me to use solution 1 or is that a mistake/dangerous? I am using DataStax C# Driver for Apache Cassandra version 3.4.1
UPDATE: Is it possible to serialize an ISession instance and send it to a client to be reconstructed and used? This would be the best of both worlds because then I could share a single process with multiple clients without having to setup a network protocol. Everytime a clients boots it just has to ask the server for the session instance and then use it as if it had been created in the host.
It's better to share the session inside the one process, but if you have multiple separate processes, then it's ok to have separate sessions if you keep number of clients relatively low. Please only note that usually driver opens connection to every node in cluster, until you explicitly override load balancing policy (but you need to do it only if you definitely know what you do).