Context
I am building an app in which 10 users need to access to position of the other 9 users in realtime.
Scalability for 10/100/1000 users would be a solid plus, but is not required in my situation.
Possible solutions
Here are the 3 possibilities I see:
- Every 5 seconds, each client POSTs their position to the server, and GETs the position of the 9 others;
- Each client opens a WebSocket connection with the server, and this connection allows the server to send them the 9 other people's position every 5 seconds (they would also have to POST their position every 5 seconds I guess);
- The clients all connect to each other in P2P using my server, and then share their positions, without using the server.
If you have any other idea, I'd be very happy to hear about it.
Question
Which one would you choose, and why ? Which one is the most efficient and safe to you ?