I am new to using MongoDB, and have a hard time understanding the way to use sessions and transactions. Currently, I am working on a project that can have multiple servers up at once, all connected to a 3 node replica set.
What I am unsure of, is how to handle sessions and transactions. So far, my first iteration would have a session being started for each transaction that would use a majority write concern and a majority read concern. However, from reading the documentation, it says a session can only have a single transaction open at once. So now I am wondering if each instance of my server should have a single session or not. This would affect concurrency as I would not be able to run multiple transactions in parallel.
One last thing, I am unsure with our choice of read concern. I am unsure what the difference between snapshot and majority read concern for a single 3 node replica set. Why would I use one over the other.
Sorry if any of this has been answered before, linking me to relevant posts would help too!
Thank you in advance.