Open zicklag opened 2 months ago
This is not that big a deal right now, but in the future, we should build some sort of strongly consistent layer on top of Leaf, possibly using multi-paxos or raft, to make sure that name registration is strongly consistent.
Might there be a far more lo-fi solution for this in UI-space?
Storefronts for cinemas and travel companies have ~10min windows for reserving your seat.
Somewhat similarly, upon hitting save on the username, couldn’t we do a little load-animation for the 1-2 seconds we’d need to assure them the username is theirs?
I.e. we wouldn’t let new users finish the signup dialog before the username-availability has been confirmed.
That's pretty much what Raft / Multi-Paxos is. The servers just vote on the new name to make sure that they all agree who gets it, and I think it could probably reserve a name in less than a second.
I think we can probably get an ultra simple version of it without much work, since all we're worried about is claiming a single username, instead of like a full database or something like that.
Right now, the way that we reserve usernames is built on Leaf's eventually consistent store.
This means that it's possible for one user to claim a username, think that it worked, and then, with very close timing, another user could claim the same name, and take it from the first user.
This window of time where it could be taken is probably in the milliseconds with a non-clustered Weird server, but with a clustered server, it could be prolonged if there was a network partition between the clustered servers.
The user would only find out that the username was taken by another user after the servers reconnected to each-other.
This is not that big a deal right now, but in the future, we should build some sort of strongly consistent layer on top of Leaf, possibly using multi-paxos or raft, to make sure that name registration is strongly consistent.