strategy for synchronisation to server
Opened this issue · 1 comments
what strategies are people using to handle synchronising to the server database ?
- Alwasy save locally
- If on line then you can the following strategies:
a. push any "dirty" records to the server and pull any dirty records to client.
b. on the server you have a normal OLTP db, but a message queue per user and global. When a client connects you grab all updates inthe correct order FIFO.
I am really confused what to use.
Here's how I do it. In my case clients can't write.
Client side, keep a 'timestamp' database with collection_name as a key and datetime (as integer) as value
To update request up to 100 documents of the specific collection that have a timestamp value greater than the client's timestamp
After the client receives the documents, update the timestamp value for that collection in the timestamps database to the newest document's timestamp.
Repeat update requests until the response contains no documents.
My use case is basically a news reader app.
You could use a push notification service to tell clients to download updates.