Simultaneous users data check interval

I’m writing an app to assign referees to matches in a competition. 2 guys, who are 2 hours drive apart, need to modify data, sometimes simultaneously. This is new for me but assume the program will have to keep checking the server for new data? If so, what sort of interval for checking the server is best? Or is there a method to ‘push’ data down? Is websockets what is needed here?

The other way I was thinking is while 1 user is editing the other users becomes read only. That any good?

Thanks in advance.

Don’t poll the server. You’ll expend so much user bandwidth that they’ll hate you. You’ll also burn a lot of your bandwidth so your ISP will charge you more.

Instead, use push notifications to alert apps of changes on the server. When you save a change on the server you call the push script and sends the push notification to the users device / your app.

You’ll have to create the necessary certificates, create an account of FCM, lock down the push id to the app names, add the plugin-push to your app and get that configured, write a script on the server to send the push packets to FCM. It’s a lot of work with tons of moving pieces but it’s the best way.

Thanks for your reply. How do google docs do it? Every keystroke appears on multiple users’ screens. Are they data hungry?

You have to create a “conversation” and from there you add people to the conversation and after that each keystroke must be uploaded to the server and then downloaded to each member of the conversation.

Most people that I’ve seen use push notifications for this as well… if you google around you’ll find examples on creating chat apps using GCM/FCM. One I have book marked but never tried is here