> On Nov 22, 2014, at 5:22 AM, Yuzkan <[email protected]> 
> wrote:
> 
> It seems that attachments are stored only within Couchbase Sync Gateway and 
> there is no way to access them from Couchbase. 

They're stored in the gateway's bucket as documents with IDs like 
"_sync:att:xxxxxx" where 'xxxxxx' is a hex SHA-1 digest of the attachment 
contents. (This may change in the future. Couchbase Server is not optimized for 
storing large documents and has a hard limit of 20MB. We plan to move 
attachments into some sort of distributed filesystem at some point.)

> We are using Sync Gateway's shadowing feature for synchronization and when we 
> work with documents that have no attachments it is safe to drop the shadow 
> bucket and re-create it again because data will be shadowed from the main 
> bucket.

Yes, there wasn't any clear way to put the attachments into the app bucket. It 
didn't seem right to copy them over as blobs with weird magic names.

> But when we work with attachments re-creating the shadow bucket is not 
> possible because it will not restore attachments. Because of that documents 
> that had attachments will not be synchronized with devices even though users 
> have access to those documents.

Unfortunately that's true. Do you have a need to delete and restore the 
shadow/gateway bucket?

A workaround would be to create an external process to watch the gateway's 
_changes feed and look for revisions with attachments, then copy them out to 
your own storage.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/1D0C7445-8016-4672-B205-1A7C2ABC217F%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to