In order to store binary files uploaded by users (such as attachments, documents or profile pictures) eXo Platform needs a file storage subsystem. There are two supported methods to perform file storage:
File System: files are stored in the server file system in a folder structure as regular files.
RDBMS: files are stored in the database as BLOBs.
You should choose either to store binary data in the database or through file system by setting the suitable value to the variable exo.files.binaries.storage.type. Choosing one file storage than the other depends on your data type and size.
Note that in case of using database as file storage, binary files are stored in the database table FILES_BINARY however in case of using file system storage, binary files are loaded from a folder of files. If you choose to store data through file system then you want to change to database or vice versa, note that you will lose data files because the source of binary files is different in the two cases. Consequently, you should choose the suitable file storage. if you absolutely need to migrate from rdbms to fs or vice versa, you need to implement a migration tool allowing to maintain your binary files.
File System storage
The primary advantage of storing files in the file system is that it is easier to see the actual files.
Through file system, it is possible to backup and manipulate files separately of the database.
Files are stored off the database keeping it lighter.
The supported file system in eXo Platform is NTFS.
Storing files in the database has many advantages such as:
The database backup will contain everything: It is easier for backup since only the database must be saved (and optionally the search indices). There is no need for a shared file system in cluster mode (database is shared in cluster mode).
The database can enforce more subtle controls on access to the files.
In case of changing files, the DBMS knows how to manage transactions.
Comparing file system and RDBMS storage
|Transaction support: This feature is needed in case of concurrent access to the same dataset.||A basic feature provided by all databases.||Most of file systems don't have this feature. Transactional NTFS(TxF), Sun ZFS, and Veritas VxFS, support this feature. With eXo Platform transaction is managed at application level.|
|Fast indexing: It helps fast retrieval of data.||Databases allow indexing based on any attribute or data-property (i.e SQL columns).||This is not offered by most of file systems.|
|Consistency check||It is feasable by all databases.||File systems also support data consistency check.|
|Clean unused data||Possible with database.||File system also ensure data cleanup.|
|Clustering||Advanced databases offer clustering capabilities (such as Oracle and Mysql).||File systems still don’t support this option (The only exceptions are Veritas CFS and GFS.|
|Replication||It is a commodity with databases.||File systems provide replication feature but still need evolution.|
|Relational View of Data||Databases offer easy means to relate stored data. It also offers a flexible query language (SQL) to retrieve the data.||File systems have little or no information about the data stored in the files because it stores files in a stream of bytes.|
When using eXo Platform in cluster mode and choosing to use file system for binary files storage, the files folder should be shared between all the cluster nodes.
File storage data backup requirements
To back up data, eXo Platform should be stopped.
In case of file system storage, to make the binary files backup, you need to:
Copy the folder of files.
Backup these 3 database tables: FILES_FILES, FILES_NAMESPACES, FILES_ORPHAN_FILES.
In case of using the database for file storage, the tables related to file storage are: FILES_BINARY, FILES_FILES, FILES_NAMESPACES and FILES_ORPHAN_FILES, but you should backup the whole database since there are links between these tables and other eXo Platform tables.
For more details about data backup in general, you can take a look on the section Backup and Restore.