The Tradeoffs of Saving Files Inside or Outside of Salesforce

Salesforce has some great features for saving files like PDFs and Microsoft Office documents within Salesforce.  Let’s review those first.

1) Documents Tab
The documents tab is a global place where files can be stored with a folder structure.  New folders can be created and files can be placed in those folders so that they are organized.  There is also a ‘My Personal Documents’ folder where documents that only you should have access to can be stored.  These files cannot be tied to individual standard or custom objects.  The folders created within the Documents Tab are all at the same level so there is not nesting of folders.

2) Notes & Attachments
In the ‘Notes & Attachments’ section of each standard and custom object files can be added.  This is an easy way of adding files that do not need any associated metadata, as attachments do not support custom fields.  An example requirement would be adding PDFs to a Contract object.  This option would be an easy way to do that, as the ‘Notes & Attachments’ related list simply needs to be added to the Page Layout for the Contract object.  One limit to keep in mind with ‘Notes & Attachments’ is that the files cannot be large than 5MB.

3) Salesforce Content
Salesforce Content helps to organize files into libraries.  This is very similar to the folder structure that can be created within the Document Tab as listed in #1 above, but, some added benefits of the Salesforce Content structure are…
A) The files placed in the library are full-text searchable.  So if you place a PDF in the library that has the words ‘Model X456Z’ in it, then that text can be found by searching Salesforce or by doing a Salesforce Object Search Language (SOSL) search.
B) Custom fields can be added to the files so more metadata about the file can be saved.  These fields get added to the ContentVersion standard object.
C) Salesforce Content has made dealing with revisions very easy.  Once a file is saved to Salesforce Content, adding a new revision to a file and keeping the old revisions is all handled by the Salesforce user interface. Revisions could not be done with the ‘Documents Tab’ or the ‘Notes & Attachments’ related list.  There will be one row saved to the ContentDocument standard object for each file and one row for each revision of that document will be saved to the ContentVersion standard object.
D) In Salesforce Content the maximum file size is 2GB, so there basically isn’t a limit.  The time where file size limits will come into play is if you are loading the files through the API or a Visualforce page.

4) Chatter Files
Chatter Files are a recent addition to the Salesforce offerings.  Chatter must be enabled for this feature to be available.  You can think of Chatter Files as combining the features of the ‘Notes & Attachments’ with ‘Salesforce Content’.  Chatter Files are like ‘Notes & Attachments’ because the files are tied directly to the standard or custom object.  The Chatter Files will show up in the chatter feed since that is where they were originally added, but they also show up in the ‘Notes & Attachments’ section as a ‘Chatter Feed’ row.  The Chatter Files are stored in some hidden libraries within the Salesforce Content so you get most of the great features of Salesforce Content, like full text searching and easy revision creation.  The one feature that is not available with Chatter Files is the addition of custom fields.  This can slightly be worked around if the files are first added to Salesforce Content and then linked to a Chatter feed. That, however, would make some processes more complicated than necessary.  If needed, that metadata can be moved up to the standard of custom object as needed.  The last great point about Chatter Files is that they are in Chatter so users can post comments about these files specifically.  Cool!

These are great features and options!  Why would you ever decide not to save your files within Salesforce?  The main time it makes sense not to save your files within Salesforce is if you are wanting to save a large amount of files and you won’t have enough storage space in your Salesforce instance.

There are two types of storage space considerations with Salesforce:

Data storage – which is the number of rows in the standard and custom objects (which I am not discussing in this blog post).

File storage – the amount of file storage is based off of the number of licenses that have been purchased. For each Salesforce license you get 612MB of file storage space. That may seem like a lot if each user is only uploading his/her own files.  But if you have a bunch of files that you need to import from an existing system, this limit can quickly be reached, especially if you do not have many licenses.

So what should you do if you are running into the file storage space limitation?

1) Contact Salesforce and ask them how much it will cost for additional storage space.  Salesforce wants you to keep your files in their platform so they should work with you to make storing those files cost effective as compared to other options.

2) If the Salesforce route does not work then you can look at storing the files at another location, either a local resource like a SharePoint server or by turning to another cloud provider like Amazon Web Services S3.  With both of these options, and the many others that are out there, you will just save the link to the file in Salesforce.  This can give you the best of both worlds at times as Salesforce offers the great object model and metadata creation capabilities and these other tools provide file storage space at very reasonable costs.
– With Amazon Web Services S3 you can hire a company to do a custom integration matching to exactly fit your needs as S3 has an open API that is easy to use.  Or you can turn to an AppExchange product like S-Drive, which has already done the integration work and will allow you to tie files stored in S3 with standard or custom objects.

How have you solved this file storage requirement before?  I would love to hear your ideas!

This entry was posted in Technology and tagged , , , . Bookmark the permalink.