Lazy load attachments

Viewing 2 reply threads
  • Author
    Posts
  • April 16, 2021 at 1:28 PM #44185

    cf
    Participant

    I have a document with many attachments, making the document quite large (many GB). Would it be possible to have a per-document setting where attachments are only downloaded when one tries to open them? This way some machines can have a full replica of the document with all attachments while others (like my iPhone) can have only the record data and lazy-fetch the documents as needed.

    April 17, 2021 at 6:49 PM #44191

    Brendan
    Keymaster

    Well, I would say that if you don’t want the database to big large with attachments, then use alias attachments instead. But those don’t sync to other devices.

    And there’s no function in CouchbaseLite (the database I’m using) to do such a thing as lazy load. Because the attachments are just stored as blob files within the database’s attachments folder on each device.

    April 17, 2021 at 9:46 PM #44194

    Sam Moffatt
    Participant

    You’d need some sort of a blob store service to handle storing the data though these days there isn’t a lack of options there. I could see some value in offloading larger files to external storage and perhaps keeping a couple of low res thumbnails on local devices. I have some chunky databases that would help with that, might even make sync’ing faster.

    What might be interesting is the ability to ship attachments to an S3 compatible blob store. That’d mean integration with AWS as a hosted service or the ability for folk to run their own store. It might also be possible to leverage iCloud Drive to store the data but that would limit cross-account sharing I think. If done properly it could be handled agnostic of underlying sync system for the non-blob document data.

Viewing 2 reply threads

You must be logged in to reply to this topic.