App Uploads: VM Disk vs Object Storage

Batuhan Esirger
Batuhan Esirger
Co-Founder & Head of Business Development
Updated Sep 20, 202616 min read
Written for: Developers, founders, and small platform teams deciding where durable SaaS uploads, media, reports, exports, and customer files should live.
Object StorageApp UploadsS3SaaSCloud StorageVM Disk
Last reviewed:
Guide
App Uploads: VM Disk vs Object Storage
rafftechnologies.com/learn
On this page

Key Takeaways

Keep temporary or regenerable files on VM disk. Move durable customer uploads to object storage when files must survive VM replacement, support multiple app instances, or scale independently from compute. Keep ownership and authorization in the database and file bodies in object storage.

Store durable customer uploads in object storage once those files must survive VM replacement, scale independently from application compute, or be shared by more than one app instance. Keep VM disk for temporary, regenerable, or low-risk files that can remain tied to one server.

For Raff Technologies workloads, that usually means keeping the operating system and application runtime on the VM, keeping structured ownership and file metadata in a database, and putting durable uploads in S3-compatible Object Storage.

The important decision is not whether a VM can store files. It can. The question is whether those files should remain part of the VM's lifecycle.

If application uploads are private, use S3 Bucket Security: Credentials, Policies, and Private Access to define bucket exposure, credential scope, and presigned URL controls.

VM disk vs object storage for app uploads: quick answer

SituationBetter starting pointWhy
Prototype or demoVM diskLowest operational overhead
Temporary processing filesVM diskShort-lived and easy to recreate
Cache or regenerable thumbnailVM diskLosing it does not lose source data
Small internal tool with low-risk filesVM disk can be reasonableSimplicity may matter more than separation
Customer uploads are product dataObject storageFiles should survive app-server changes
Multiple app servers or workers need the same filesObject storageShared API access avoids server-to-server file sync
Upload volume grows independently from CPU/RAMObject storageStorage capacity can scale separately from compute
Private files need controlled downloadsObject storagePresigned URL or controlled API patterns fit well
Reports, exports, media, and attachments need retentionObject storageThese are durable file objects
App VM is being resized mainly because uploads are growingObject storageStorage growth should not force compute growth

A useful rule is:

If replacing the application VM should not mean migrating or recovering customer files, those files should not live only on the VM disk.

For the wider storage decision, see Object Storage vs Block Storage vs VM Disk.

App uploads become production data when users depend on them

Uploads include more than profile pictures.

Typical SaaS and web-app file data includes:

  • user avatars and images;
  • PDFs and documents;
  • product media;
  • attachments;
  • CSV imports;
  • generated reports;
  • invoices;
  • exports;
  • audio and video;
  • design assets;
  • application-generated archives.

These files often start in a local directory:

Text
App VM ↓ /var/www/app/uploads

That can be perfectly reasonable at the beginning.

The architecture changes when that directory becomes the authoritative copy of customer data. At that point:

  • a VM rebuild becomes a file-recovery event;
  • a second app server creates a synchronization problem;
  • growing uploads increase pressure on the server disk;
  • VM backups get larger because application files are mixed with compute state;
  • moving or resizing compute can require moving customer files too.

The storage layer is now controlling the compute lifecycle.

Keep VM disk for files that belong to one server

VM disk remains the simplest option when the files are naturally coupled to the application server.

Good examples include:

  • temporary upload staging;
  • image-processing scratch space;
  • caches;
  • generated files that can be recreated;
  • short-lived exports;
  • package or application artifacts;
  • local development files;
  • low-risk internal-tool files with a documented backup path.

VM disk is especially reasonable when all of these are true:

  • there is one application server;
  • file growth is predictable;
  • files are not critical customer records;
  • the workload can be restored as one unit;
  • there is enough disk headroom;
  • no other server or worker needs the same files;
  • simplicity is more valuable than independent storage lifecycle.

A single-server architecture is not automatically bad architecture. Separation is useful when it solves a real lifecycle, scaling, recovery, or multi-server problem.

Move durable customer files to object storage

Object storage gives application files a lifecycle independent from the VM.

A common production model is:

Text
User uploads file ↓ Application validates request ↓ Object Storage stores file ↓ Database stores owner + object key + metadata

Decision matrix showing VM disk, database metadata, and object storage for app uploads

This boundary improves several things at once.

Compute becomes replaceable

The app server can be rebuilt, resized, reimaged, or duplicated without first copying the entire upload directory.

File capacity can grow independently

If customer uploads double but CPU and RAM demand stay flat, the application should not necessarily need a larger VM.

Multiple application instances can use the same files

Stateless app nodes and workers can retrieve the same objects through the storage API rather than maintaining synchronized local directories.

File delivery gets its own access model

Applications can keep objects private and grant controlled access after checking user or tenant permissions.

VM backup scope becomes cleaner

The VM backup can focus on server state while durable file data uses a storage and recovery model designed for objects.

Store file metadata in the database and file bodies in object storage

For most SaaS applications, the clean pattern is:

Database = business state. Object storage = file body.

A file record can contain fields such as:

FieldPurpose
idApplication-level file ID
user_id / account_idOwnership boundary
object_keyLocation in object storage
original_filenameUser-facing filename
content_typeMIME/content type
size_bytesFile size
statusUploading, processing, ready, failed, deleted
visibilityPrivate, public, or controlled
checksumIntegrity or deduplication signal
created_atCreation time
deleted_atDeletion workflow state

The database answers:

  • who owns the file;
  • which customer or project it belongs to;
  • whether the user may access it;
  • whether processing completed;
  • whether the file should still exist.

Object storage answers:

  • which object exists;
  • how it is retrieved;
  • how large it is;
  • which storage key identifies it.

This separation makes authorization and storage responsibilities easier to reason about.

S3 uploads are an application integration pattern, not a storage architecture by themselves

Searches for S3 uploads often mix two separate questions:

  1. Where should durable application files live?
  2. How should the browser or application upload those files?

This guide answers the first question. Once object storage is the chosen file layer, the upload path can be implemented in several ways.

App-server proxy upload

Text
Browser ↓ App server ↓ Object storage

This is simple to understand, but large uploads consume application-server bandwidth and connection time.

Direct-to-object-storage upload

Text
Browser ↓ request authorization App server ↓ returns controlled upload permission Browser ↓ Object storage

A direct-upload design can reduce load on application servers, especially for larger media or document uploads.

The application should still control:

  • who may upload;
  • allowed size;
  • allowed content type;
  • destination object key;
  • ownership metadata;
  • post-upload processing;
  • deletion permissions.

Do not treat direct upload as bypassing application authorization. The app authorizes the operation even when it does not relay every byte.

Presigned URLs help keep private uploads off the public internet surface

A common S3-compatible pattern is to keep objects private and issue time-limited presigned URLs after the application verifies access.

For downloads:

Text
User requests file ↓ Application checks tenant + permission ↓ Application creates short-lived signed URL ↓ User downloads object

For uploads:

Text
User requests upload ↓ Application validates account + file policy ↓ Application creates controlled upload permission ↓ Client uploads object

This avoids making an entire bucket public just because users need temporary access to particular files.

AWS documents the general S3 presigned URL model in its presigned URL documentation. For Raff, use the capabilities documented on the current Object Storage page as the source of truth for provider-specific behavior.

Upload security must be designed above the storage layer

Moving files to object storage does not make uploads safe automatically.

The application should define controls for:

  • allowed file types;
  • maximum upload size;
  • authentication;
  • tenant ownership;
  • authorization before upload and download;
  • filename handling;
  • content validation;
  • malware scanning where appropriate;
  • processing isolation;
  • credential scope;
  • deletion permissions;
  • logging and auditability.

The OWASP File Upload Cheat Sheet is a useful security reference because upload risk comes from application behavior as much as from the storage system.

Do not rely on an unguessable object key as authorization. A user should receive access because the application verified permission, not because the URL happened to be hard to predict.

Multi-server applications should avoid local upload ownership

The weakness of VM-local uploads becomes obvious when a second application instance is added.

Suppose uploads remain on local disk:

Text
Load balancer ├── App VM A → /uploads └── App VM B → /uploads

Now a file uploaded through VM A may not exist on VM B.

Teams usually respond with one of four patterns:

  • synchronize upload directories;
  • force sticky sessions;
  • mount a shared filesystem;
  • move durable files into object storage.

For ordinary web and SaaS uploads, object storage is often the cleaner boundary because every stateless application instance can use the same file API.

Text
Load balancer ├── App VM A ─┐ └── App VM B ─┼→ Object Storage Workers ──┘

This also makes app-node replacement easier because no individual node owns the customer file set.

Object storage is not the right answer for every application file

Use object storage for file-like data that works naturally through an API.

Strong fits include:

  • uploads;
  • images;
  • video;
  • documents;
  • generated reports;
  • exports;
  • archives;
  • static assets;
  • backup artifacts.

Do not force object storage onto workloads that require ordinary mounted filesystem semantics.

Examples that may fit block storage better include:

  • self-hosted database data directories;
  • search indexes;
  • stateful application directories;
  • persistent Docker service data;
  • software that expects normal in-place filesystem I/O.

For that distinction, use Block Storage for Databases & Containers: When to Use Volumes.

Separate storage growth from compute growth

One of the strongest commercial and operational reasons to move uploads out of the VM is independent scaling.

Imagine the application has enough CPU and RAM, but customer documents are growing rapidly.

With VM-local uploads:

Text
more customer files → more VM disk pressure → larger server / migration pressure

With object storage:

Text
app compute remains adequate → object capacity grows independently

The application server can then be sized for application runtime rather than for years of accumulated customer files.

This does not mean object storage always reduces cost. The correct comparison includes:

  • stored capacity;
  • data-transfer pattern;
  • request/access pattern;
  • engineering work;
  • backup/recovery design;
  • operational complexity;
  • whether file growth would otherwise force larger compute.

Use the live Raff Object Storage and pricing pages for current commercial values instead of relying on hard-coded numbers in an evergreen guide.

Recovery should treat files and metadata as one business dataset

Separating file bodies from the application VM improves architecture, but recovery still needs coordination.

If the database says a customer owns object accounts/42/invoices/a.pdf, recovery is incomplete if:

  • the database record exists but the object is missing;
  • the object exists but the database record is gone;
  • the database is restored to Monday while files reflect Wednesday deletions;
  • credentials cannot access the bucket after recovery;
  • a restored application points at the wrong environment or object prefix.

Recovery planning should define:

  • database recovery point;
  • object/file recovery expectations;
  • credential recovery;
  • deletion behavior;
  • how application-to-object consistency is checked;
  • how restored environments avoid writing into production storage accidentally.

For the wider model, see Cloud Storage Architecture for Production Apps: Backup & Recovery.

Migration from VM disk to object storage should end with one source of truth

A safe migration does not require a big-bang cutover, but it should have a clear end state.

A practical sequence is:

  1. Create a structured file record. Record ownership, current path, target object key, type, size, and migration status.
  2. Define the bucket/key model. Decide how tenants, projects, or file types map into object keys.
  3. Copy existing files. Upload current durable files and verify representative objects, counts, sizes, and checksums where practical.
  4. Switch new writes. New durable uploads should go to object storage.
  5. Use temporary read fallback if needed. During migration, read object storage first and local disk second.
  6. Verify production workflows. Upload, download, delete, authorization, processing, export, and recovery flows should all work.
  7. Remove local authority. Delete old local copies only after the new source of truth is proven.

The dangerous state is indefinite dual ownership.

If half the files are authoritative on the VM and half are authoritative in object storage, every incident and migration becomes harder to reason about.

How Raff fits the app-upload architecture

Raff currently provides the infrastructure layers needed for this separation:

Architecture diagram showing Raff VM, database metadata, and Object Storage for SaaS app uploads

Text
Users ↓ Raff VM / Raff Apps └── application runtime Database layer └── ownership, object keys, status, metadata Raff Object Storage └── durable uploads, media, reports, exports

Raff Object Storage is S3-compatible, so applications can use common S3 SDK and API patterns for object operations. Current pricing, limits, supported S3 features, access controls, and other mutable product details should be verified on the live product page before implementation.

A clean workload mapping is:

  • Raff VM → OS and application runtime;
  • Object Storage → durable API-addressed files;
  • Managed Databases or a self-hosted database → structured metadata and ownership;
  • Volumes → disk-like state when an application truly needs filesystem semantics;
  • Data Protection → recovery workflows for the infrastructure layers it protects.

The objective is not to use every product. It is to keep customer files from becoming an accidental dependency on one replaceable application server.

Separate durable uploads from application compute when files need to survive VM replacement, support multiple app instances, or scale independently from the server disk.

Decision checklist

Keep uploads on VM disk when most of these are true:

  • Files are temporary, regenerable, or low-risk.
  • One server owns the workload.
  • File growth is modest and predictable.
  • Losing/restoring files with the VM is acceptable.
  • No other app instance or worker needs shared access.
  • Simplicity is more valuable than an independent file lifecycle.

Move uploads to object storage when most of these are true:

  • Files are durable customer or product data.
  • App VMs should be replaceable without moving the file set.
  • Multiple app servers or workers need the same files.
  • File capacity grows independently from CPU/RAM.
  • The application can use S3-compatible APIs or SDKs.
  • Private files need controlled, temporary access.
  • Uploads should not enlarge every VM backup.

Common mistakes

Keeping permanent customer uploads on one app server

It works until server replacement, disk growth, or horizontal scaling turns the upload directory into infrastructure debt.

Moving files to object storage but keeping authorization in the URL

Object keys are identifiers, not permissions. Validate user and tenant access in the application.

Sending every large upload through the app server forever

For suitable workloads, direct S3-compatible upload patterns can reduce application-server bandwidth and connection pressure.

Using object storage as a database disk

Object storage is not a drop-in active data directory for conventional PostgreSQL, MySQL, MongoDB, or similar engines.

Keeping two authoritative file stores after migration

Choose one final source of truth and complete the transition.

Hard-coding product pricing and limits into architecture guidance

Commercial values and supported features can change. Use live product documentation for implementation-sensitive details.

Conclusion

For app uploads, the VM disk vs object storage decision is mainly about lifecycle.

Keep temporary, regenerable, and low-risk files on VM disk when they can remain tied to one server. Move durable customer uploads to object storage when they must survive VM replacement, scale independently, or be shared across several application instances and workers.

Keep business metadata and authorization in the database, keep durable file bodies in object storage, and keep the application server replaceable.

Continue with S3-Compatible Object Storage Use Cases for Developers for broader S3 patterns, or Object Storage vs Block Storage vs VM Disk for the full storage-type decision.

Frequently asked questions

Where should SaaS app uploads be stored?

Temporary or low-risk files can remain on VM disk. Durable customer uploads usually fit object storage once they need to survive server replacement, grow independently from compute, or be accessed by multiple app instances.

When is VM disk acceptable for user uploads?

VM disk is reasonable for prototypes, temporary processing, small internal tools, regenerable files, and simple single-server workloads where file recovery can remain part of the VM recovery process.

Why use object storage for production uploads?

Object storage separates durable files from application compute. Files can survive VM replacement, scale independently, and be accessed by multiple app servers or workers without synchronizing local directories.

Should uploaded files be stored directly in the database?

Usually store file ownership, permissions, status, metadata, and the object key in the database while object storage holds the binary file body. Small transactional objects can be exceptions when the application has a clear reason.

What are S3 uploads?

S3 uploads are file transfers to an S3-compatible object-storage API. Applications can proxy the upload through their own server or authorize a direct client-to-object-storage upload depending on security, file size, and workflow requirements.

How should private uploads be served?

Keep files private by default, verify account or tenant permission in the application, then grant controlled access through the supported object-storage API or a short-lived presigned URL pattern where appropriate.

Is object storage better than block storage for uploads?

Usually yes for files such as images, documents, media, reports, and exports. Block storage is a better fit when software requires a mounted filesystem or disk device rather than object API access.

Does moving uploads to object storage replace backups?

No. It separates active files from one VM, but the application still needs an appropriate recovery model for file deletion, database-to-object consistency, credentials, and other business recovery requirements.

Sources

Was this article helpful?
Batuhan Esirger
Batuhan Esirger
Co-Founder & Head of Business Development

Batuhan Esirger is Co-Founder and Head of Business Development at Raff Technologies. He leads business development, partnerships, and customer strategy, focusing on practical cloud infrastructure solutions for businesses and MSPs.

Put it into practice

Spin up a Raff server, follow the steps above on real infrastructure, and you are live. Linux or Windows, backed by a 14-day money-back guarantee.

Frequently asked questions

Where should SaaS app uploads be stored?
Temporary or low-risk files can remain on VM disk. Durable customer uploads usually fit object storage once they need to survive server replacement, grow independently from compute, or be accessed by multiple app instances.
When is VM disk acceptable for user uploads?
VM disk is reasonable for prototypes, temporary processing, small internal tools, regenerable files, and simple single-server workloads where file recovery can remain part of the VM recovery process.
Why use object storage for production uploads?
Object storage separates durable files from application compute. Files can survive VM replacement, scale independently, and be accessed by multiple app servers or workers without synchronizing local directories.
Should uploaded files be stored directly in the database?
Usually store file ownership, permissions, status, metadata, and the object key in the database while object storage holds the binary file body. Small transactional objects can be exceptions when the application has a clear reason.
What are S3 uploads?
S3 uploads are file transfers to an S3-compatible object-storage API. Applications can proxy the upload through their own server or authorize a direct client-to-object-storage upload depending on security, file size, and workflow requirements.
How should private uploads be served?
Keep files private by default, verify account or tenant permission in the application, then grant controlled access through the supported object-storage API or a short-lived presigned URL pattern where appropriate.
Is object storage better than block storage for uploads?
Usually yes for files such as images, documents, media, reports, and exports. Block storage is a better fit when software requires a mounted filesystem or disk device rather than object API access.
Does moving uploads to object storage replace backups?
No. It separates active files from one VM, but the application still needs an appropriate recovery model for file deletion, database-to-object consistency, credentials, and other business recovery requirements.