Couchbase Mobile document expiration - restoring purged documents?

I’m working on a collaborative app that lets businesses document problems with their equipment. This mainly involves text, but it can include photos that are stored as attachments. But if many different users add photos, the storage needed in each device will snowball over time.

I 've just seen Hod Greeley’s blog article about the new document expiration feature for Couchbase Mobile. And I’m thinking that maybe I can put each photo into a separate document that’s set to expire after a month or two. Then after that time, each device would still have the main document with the text that describes the problem, but the document with memory-hogging photo would be purged.

But the drawback with this approach is that the user may want to see the original photo again in the future - say if the same problem happened again a few months later. From Hod’s article it sounds like the document with the photo would still be present on the server. But unless someone updated that document, the user couldn’t restore it to their device.

So I’m wondering if there is a way around this? For example, is there a way that you could force a document with a specific ID to be re-synced to a particular device?

I talked to someone the other day with the same problem.

Storing Blobs in any database is not the best idea, especially a memory centric database, but Couchbase Mobile makes it so easy to sync data.

What you can do is sync the document still and maybe at the end of the day have a process/app find all the new attachments for the day and put them into a CDN. then update the document with the new URL and sync it back down to the device and then remove the attachment from CouchBase server.

Don’t sweat storing Blobs in CBL. We’re pretty smart about managing them.