I am wondering if CouchBase system would survive a server data loss if we have attachments stored on mobile devices?
Lets say we have 2 iPhones with CBLite and each push 100 documents with attachments to server. And these documents have many changes so that attachments’ revpos do vary. Some have also changes where only JSON was changed but not the attachments. On this scenario, server is lost and started from scratch without any data. CBLite replication would start replication from the begining again - but is everything needed there to replicate back all these attachments too?
I am afraid that CouchDB style replication would need every document rev pushed separately, because attachments’ revpos relate to certain _rev:s. Revpos cannot refer to non-existeng version I guess? So replicating only the current, newest state from iPhones to server would not work?
(Interesting question is also that could CouchDB replication protocol allow referring to non-existing revision in revpos?)
This topic relates to our current use case. Would be nice to hear if someone has insight if this is supposed to “just work” or do we have to take some precautions while designing this. One “safer” solution could be to have separate documents for attachments…