← All topics

What is storage?

A profile picture should still load after you release a new version of the application. That requires a place to store it that survives replacing the application container.

The profile and its picture are separate pieces

Storage holds files such as images, documents and exports. A profile picture often lives in file storage, while the database holds the user record and a path or key the application uses to find that picture.

Both pieces need to stay connected. A database record cannot display a missing file, and a file with no link to a profile may sit unused in storage.

Uploads need to survive a container replacement

A container holds the running application. Files written only to its internal filesystem can be lost when that container is replaced. Persistent storage lives outside that filesystem and is made available to the application again.

For the profile picture, this means the new version can still find the same file at the stored path. Whether that storage uses a server disk, a network drive or an object store depends on the architecture.

Access rules and backups need separate attention

The application must check who may upload, open or delete files. It also needs rules for the file types and sizes it accepts. A private document calls for different access rules from a public profile picture.

Persistent storage is not a backup. Keeping files outside the container does not recover a deleted file or repair a failed disk. Recovery requires suitable backups and a check that they contain the files you need.

Where a MainPath backend writes uploads

In the documented backend deployment on a server, uploads live under ./backend-uploads, outside the container. The deployment mounts that directory at /app/upload inside the container. Locally, the backend uses ./upload. Your code needs to write uploads to this intended location.

The backend publishing documentation explains these paths. Projects with a MySQL backend can separately enable Easy Backup to back up the database and uploads. A successful release alone does not confirm that a backup exists or that a restore has been tested.

Thank you for your request

We have received your request and will get back to you as soon as possible.

Would you like to talk to us directly?

Choose a time here for an introductory call with Robin.

Open the calendar in a new tab