File Storage Path

Hello,

In your guides it says:

The File Storage subsystem separates the storage of the file metadata from the file binary. It stores metadata about the file in the relational database and the raw file binary in the filesystem.

As far as I understand after upload, a file.txt is divided in two parts: metadata is keep in the relational database and raw file is codded binary and kept somewhere in the project. Where? Where is the path to binary?

Imagine that I upload 1GB of files in Cuba app. Are there safe to keep all this information in Cuba App and deleted from the Hard Disk? What happens if the metadata from the relational database is corrupted. Is there any possibility to recover the data?

Please advise.

Hi,

You can find answers in the documentation: Standard File Storage Implementation - CUBA Platform. Developer’s Manual

If files are deleted - they are lost without ability to recover. You should organize production environment carefully, ensuring that these files are not lost, not deleted accidentally. E.g. set up periodic backups of the file storage folder to another disk or server.

Another option is to use cloud file storage implementation: Amazon S3 File Storage Implementation - CUBA Platform. Developer’s Manual
It allows you at least not to worry about storage hardware failures.

Thank you!