S
S
Sergey Sokolov2020-06-05 09:41:08
Algorithms
Sergey Sokolov, 2020-06-05 09:41:08

Distributed system: how to allow a single user connection?

The game runs on several identical backend servers. The user connects via WebSocket via Load Balancer to one of them.

How can I disable previous user sessions on new connection?

The previous one may be on a different backend than the one processing the new connection. There is no central base, all nodes are the same. The results are exchanged only at the end of the game. Each Back has a list of all backs and its place in it.

The thought so far is only to add a command-response: on a new connection, interrogate the rest of the backs: “came {userid=XXX, timestamp=YYY, back=ZZ}, if you have such an older connection, disconnect.”

What other options are there without central/shared storage?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2020-06-05
@bacon

Load Balancer can sticky sessions?

X
xmoonlight, 2020-06-05
@xmoonlight

Make a new hash (session token) for the user on a new connection. It will overwrite the old one and all other sessions will automatically become invalid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question