> On Jun 14, 2015, at 2:57 PM, Brendan Duddridge <[email protected]> wrote: > > Given that I may have thousands of document attachments, does it make sense > to store them as regular attachments in CouchBaseLite on iOS so they end up > in the attachments folder next to the database? It could be a ton of files > for a single folder to manage.
Thousands of files in a directory is no problem for HFS+. > It would be difficult for a customer to be able to go to the Finder and find > a file they wanted without navigating to it via the application. I know a lot > of users just really like to have their files easily reachable in the Finder. Attachments are not meant to be user-visible files. The only reason attachments are stored as individual files at all is because it’s more efficient than putting them in the database. The contents of the Attachments directory should never be modified by anything other than CBL. The only reason there’s an API to get the path to an attachment file is to support some system APIs (like ones for media playback) that require paths/URLs. > Also, what do you do about aliases to files? Do they still work with CBL? Can > an attachment point to a file elsewhere on the disk in the Mac version? No. > Also, in my Mac app I have a "Show in Finder" button which takes the user > directly to the file attachment. Currently with CBL this would just show them > a .blob file I believe. I guess the only real way to handle that properly > would be to have an Export function instead which would copy the file > attachment out to a location of the user's choosing. That would be reasonable. The Attachments directory is a content-addressable store. Attachments are named by their SHA-1 digests, and any attachments with the same contents in a database (even if they have different filenames or types) will be stored as the same file. That should make it clear why attachment files should never be modified! —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/93B65558-0CB0-4F3C-B2A4-800121635CA3%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
