Realtime UI DB connection

In my apps where multiple users could edit the same document, I use a timer as mentioned by @jshaffstall.

The document is served with a timestamp.

Every 5 seconds a timer checks if that document has been modified, and if it has been modified it shows an alert showing the name of the user that modified it and asking to reload.

When the user saves the document, the timestamp is checked again and the save is aborted if the document was modified in the last 5 seconds.

I have about 10 users using the app at any given time, and they are happy with this setup.

1 Like