Replies: 5 comments 1 reply
-
If you have a backup server, how do you switch to it? If this is a cluster, it will happen automatically. The issue of collision is that you may have the same action happen on both nodes to reserve a range at the same time. In a two node cluster, we recommend having the main node as a member and the other as a watcher, yes. |
Beta Was this translation helpful? Give feedback.
-
Since cluster might be a way to go, how high is the chance of a collision, let's say we got 2 users, on 2 PCs running, is it possible that the first "client1" will get HiLo with max 32, and "client2" which is connected to node2, also gets HiLo with max 32 (so they will both generate the same ID's, when I disable the suffix -A/-B? If that's true, a client might have to press 16 or 32 times on save (don't know how high the hilo bump is) to fix the "issue" of conflicts. Is this chance the same on double replication? Since we used that for a long time but never had an issue with conflicts (well ok, rarely)? Or is it maybe possible to set a server to WRITES/READS only and the other server to READS so that conflicts can't happen... since only one server is touching the HiLo. |
Beta Was this translation helpful? Give feedback.
-
There is a chance for that, yes. In terms of likelihood, not much. You need to have a disconnect in the network, two clients that reach different nodes at the same time, etc. You also need multiple clients in this scenario, mind. |
Beta Was this translation helpful? Give feedback.
-
By default, we have a single writer active, the second one is only active is there is a failur. |
Beta Was this translation helpful? Give feedback.
-
There are multiple clients, I don't know how RavenDB will place them, but if it normally (when both nodes are up) the HiLo won't fail, than that's good enough for me. But I don't know if different clients will read from different nodes, and are able to get a HiLo which is already changed on another server to a higher number. So Client 1 -> Node A Or will Client 1 and Client 2 normally always connect to 1 node to get the HiLo from. Else it looks like there is a small chance that the HiLo is changed on Node A, not yet replicated on Node B, and client 2 therefor get's an older HiLo and starts generating duplicates / conflicts. |
Beta Was this translation helpful? Give feedback.
-
Client wants to have 1 main server, and one backup in case of loss of the first one.
P.s. in order to use cluster, I could also rewrite the ID generator to give ID's like: users/123 1 and users/123 2 (where 1 = cluster A, 2 is cluster B).
Maybe you could also enlighten me how big the chance is that a collision occurs between the 2 clusters (so get users/123-A and users/123-B), or maybe it's possible to use 1 node as WRITE only and both for READ. I found an old blog post of 2019 stating that 2 node clusters are possible, but that you have to make 1 server a Watcher, not Member.
Beta Was this translation helpful? Give feedback.
All reactions