By default files are stored in a file system of middleware servers and files are saved on all servers if you save it using FileUploading from the web client. You can use any third party replication for files such as dedicated NAS or simple NFS.
More information about default FileStorage you can find here https://doc.cuba-platform.com/manual-6.1/file_storage_impl.html
If you want to change mechanism of storing files you can implement your own FileStorage to store files in a database. For example see additional implementation of FileStorage - com.haulmont.cuba.core.app.filestorage.amazon.AmazonS3FileStorage.
You can enable your implementation instead of the standard one by declaring it in the spring.xml file of the core module:
FileDataProvider uses FileStorage to obtain files from a middleware and you can continue using it even if you replace implementation of FileStorage.
We don’t have request scope files and we don’t store the content of files in memory. You can manipulate with a temporary file in the web client using FileUploadingAPI.getFile(uploadField.getFileId()), for example, you can save byte content of the file directly to an entity field.