Good morning everybody
we are using couchbase lite 1.4 for android with sync_gateway 1.4 and unfortunately we cannot move from those versions. We also have a server side implemented with node.js
We have a couple of scenario which I would like to discuss:
Scenario 1. Creation from the phone and delete on the server
We generate from an android application some documents just to feed the server, the phone does not care about the document once it has been created. The app always has a continuous push/pull replication active
Then the server will elaborate the document, and it move it out from the channel of the phone.
The server once it has elaborated the information it will delete the document, so it is gone for us.
So here I have a some questions:
- Has the phone to delete or purge the document after the creation? or is it automatically done by the change of the channel?
- Must the application purge the local document? when we have to do it? Do we need to check the actual sync to the server before the purging or is it better to set an expiration time?
- By our tests it looks like moving the document out of the phone channel will remove the document from the mobile application, but it’s not clear if it still consuming space or it has any impact on the performance of the database.
Scenario 2. A Document on phone channel will be deleted by the server
In this case the document is on the phone channel, and the server decide to delete the document (using the sync_gateway api) and propagate the deletion on any mobile device.
According to https://docs.couchbase.com/sync-gateway/1.4/sync-function-api.html the deleted document will not be part of the channel of the phone.
I don’t really understand how the mobile application can be notified about the deletion of the document on the server if the tombstone is out of the phone channel. Then what happens if the phone is offline and days later it will be turned on? Does it still get the deletion notification?
Sometime it happens the document is deleted from the server but it still exists on the mobile database, and also there is no way to notify the deletion without re-generate the document and deleting it again.
Sorry to be so long.
It’s very important to me to truly understand the lifecycle of the document with or without the usage of the channel.
Thanks for any feedback, comment question…