Attachment storage organization

55 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 5, 2015, 5:55:28 PM6/5/15
to mobile-c...@googlegroups.com
Hi,

I know that attachments get stored in a folder along side the database file (at least on iOS in CouchbaseLite), but I'm wondering what happens on the server? If I use attachments and I have say 20,000 users, each with 10,000 records in their local database, and each record contains 10 photo attachments, does that mean I'm going to have 20,000 x 10,000 x 10 = 2,000,000,000 photos in that one folder on the server? Does Couchbase segregate files and data by user at all? That's an awful lot of files for one folder.

Thanks,

Brendan

Jens Alfke

unread,
Jun 5, 2015, 6:09:39 PM6/5/15
to mobile-c...@googlegroups.com
On Jun 5, 2015, at 2:55 PM, Brendan Duddridge <bren...@gmail.com> wrote:

I know that attachments get stored in a folder along side the database file (at least on iOS in CouchbaseLite), but I'm wondering what happens on the server?

Sync Gateway does not store attachments as files. They’re stored in the same Couchbase Server bucket (=database) as the documents. This isn’t an ideal solution either, as it limits their size to  20MB, but there are no scalability issues.

Eventually we plan to have Sync Gateway use an external filesystem for attachments, but it’ll be a distributed filesystem (possibly CBFS) that can scale to the capacity we need.

—Jens

Brendan Duddridge

unread,
Jun 5, 2015, 6:39:34 PM6/5/15
to mobile-c...@googlegroups.com
Ah ok. That's good to know. Ya, it would be helpful to be able to store files greater than 20 MB. I have no idea what size files my customers attach to their records. I know some use it to link to video files, although most link just to PDF, Word, and Excel files.

Todd Freese

unread,
Jun 7, 2015, 12:25:12 PM6/7/15
to mobile-c...@googlegroups.com
+1 on supporting files over 20 MB. I run into this limit all the time with video files in my app.

T

Jens Alfke

unread,
Jun 7, 2015, 5:03:52 PM6/7/15
to mobile-c...@googlegroups.com

On Jun 7, 2015, at 9:25 AM, Todd Freese <to...@filmworkers.com> wrote:

+1 on supporting files over 20 MB. I run into this limit all the time with video files in my app.

Reply all
Reply to author
Forward
0 new messages