I have been reading the documentation for transactions and bacthed operations in Firestore but I think I am not understanding this correctly. An atomic transaction is an indivisible and irreducible series of database operations such that either all occur (for example, updating multiple documents that depend on each other with the state of the system), or nothing occurs, and I was developing supposing that batched writes will also provide isolation.
In other words, what I am trying to ask is, how to handle the situation of simultaneous users writing the same document? That is, how to make the data update correctly in order for it, correctly handling concurrency.
The truth is that I don't know if I'm getting it right.
For example, if a user wants to enter a room where there can only be two people (room.size < 2). Applying a transaction (get room + update size) would guarantee that size always takes the expected values and is updated simultaneously? I thought that yeah, but now I am not sure, because of what I said in the first paragraph.
Or is the CID from ACID provided by default on all Firestore operations?