Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store doc attachments in CBFS #59

Closed
snej opened this issue May 1, 2013 · 2 comments
Closed

Store doc attachments in CBFS #59

snej opened this issue May 1, 2013 · 2 comments

Comments

@snej
Copy link
Contributor

snej commented May 1, 2013

Storing doc attachments in the main bucket is inefficient, limits them to something like 40MB, and puts lots of extra documents in the bucket (which we want to avoid.)

We should instead store them externally, probably as a content-addressable store the way Couchbase Lite does. CBFS would be the best way to do this, since the files need to be accessible from anywhere in the cluster.

@ghost
Copy link

ghost commented May 3, 2013

+1

But I think it will create other issues, when I first started with CouchCocoa and iriscouch, I frequently saw sync issues with large files 20-40Meg from mobile devices. The issue was that a stable connection could not be held open long enough for the binary attachment transfer to complete, often resulting in 5+ attempts to sync those files.

I realize it would probably break the CouchDB replication protocol, but if sync_gateway is going to be able to support large attachments, there really needs to be a way to chunk the data when replicating to support unreliable mobile connections.

At the App level I have been looking at using a channel to represent a binary file and have that channel contain multiple documents each with a chunk of the data. I use a hash tree to allow the chunks to be validated and reassembled, out of order if necessary.

But if this was built into the replication it would make the task of syncing large attachments with mobile devices a lot more practical.

@snej
Copy link
Contributor Author

snej commented May 6, 2013

Good point — I decided to split it off into a new bug because it's not directly related to how we store the attachments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant