Databases & Storage

Object Storage Explained: S3-Compatible Storage for Backups and Media

By NileVPS Team · Published · 4 min read

اقرأ المقال بالعربي

Object storage is a way of storing data as whole objects inside flat containers called buckets, accessed over HTTP instead of through a mounted file system. It has become the default home for backups, user uploads, static assets and log archives, mainly because it scales without you managing disks or partitions. Most providers now speak the same dialect, the Amazon S3 API, so a tool that works with one S3-compatible service usually works with the others. This article explains how object storage differs from the disk in your VPS and how to use it well.

Block, file and object storage

Your VPS disk is block storage: the operating system formats it with a file system such as ext4 or NTFS and reads or writes small blocks with very low latency. File storage (NFS, SMB) shares a file system across machines. Object storage is different again:

FeatureBlock storage (VPS disk)Object storage
Access methodMounted file systemHTTP API (S3)
LatencyVery lowHigher, per request
Modify part of a fileYesNo, objects are replaced whole
Capacity growthResize the diskGrows as you upload
Best forDatabases, OS, appsBackups, media, archives, static files

The key rule: do not run a database directly on object storage. Databases need fast random writes inside files, which is exactly what block storage provides. For more on disk types, see choosing VPS storage.

Core concepts

Buckets and keys

A bucket is a named container. Inside it, each object has a key, such as backups/2026/11/db.sql.gz. The slashes look like folders, but the namespace is actually flat; tools simply display prefixes as directories.

Metadata

Each object carries metadata: size, content type, an ETag (often a hash of the content) and any custom headers you set. Setting the correct Content-Type matters when you serve files directly to browsers.

Access control

Access is controlled with access keys (an access key ID and a secret key) plus bucket policies. Keep buckets private by default and grant public read only to the specific prefix that must be public, such as a folder of website images. For temporary access to a private file, generate a pre-signed URL that expires.

Versioning and lifecycle rules

Many S3-compatible services support versioning, which keeps older copies when an object is overwritten or deleted, and lifecycle rules, which delete or transition old objects automatically. Together they are a strong defense against accidental deletion and ransomware that overwrites backups. Check which features your provider actually supports before relying on them.

Using object storage from a VPS

With the AWS CLI

The AWS CLI works with any S3-compatible endpoint if you pass --endpoint-url:

aws configure          # enter access key, secret key, region
aws s3 ls --endpoint-url https://s3.example-provider.com
aws s3 cp backup.tar.gz s3://my-backups/daily/ --endpoint-url https://s3.example-provider.com

With rclone

rclone is popular for syncing directories and scheduled backups. After running rclone config and creating a remote named store of type S3:

rclone copy /var/backups store:my-backups/server1 --progress
rclone ls store:my-backups/server1

Use rclone copy rather than rclone sync for backups unless you understand that sync deletes destination files that no longer exist locally.

Automating a nightly database backup

#!/bin/bash
set -euo pipefail
STAMP=$(date +%F)
pg_dump -U app appdb | gzip > /var/backups/appdb-$STAMP.sql.gz
rclone copy /var/backups/appdb-$STAMP.sql.gz store:my-backups/db/
find /var/backups -name 'appdb-*.sql.gz' -mtime +7 -delete

Schedule it with cron (crontab -e, then 30 2 * * * /usr/local/bin/db-backup.sh). This gives you an offsite copy in addition to VPS snapshots, which matches the 3-2-1 idea described in our website backups guide.

Self-hosted S3-compatible storage

If you want to run your own object store, projects such as MinIO, Garage and Ceph's RADOS Gateway expose an S3-compatible API. This is useful for development, internal tools or keeping data within your own servers. Remember that a self-hosted store on one VPS is not offsite: if that server fails, the data goes with it. Review each project's current license and distribution terms before adopting it.

Security checklist

  • Create a separate access key per server or application, with access only to the buckets it needs.
  • Never commit access keys to Git; store them in environment files readable only by root or the service user.
  • Encrypt sensitive backups before upload, for example with rclone crypt or gpg.
  • Enable versioning or object lock where available for backup buckets.
  • Test restores regularly; a backup you have never restored is only a hope.

FAQ

Can I mount object storage as a normal drive?

Tools like rclone mount and s3fs can present a bucket as a folder, but it still behaves like object storage underneath: higher latency and whole-object rewrites. It is fine for occasional file access, not for databases or busy applications.

What does S3-compatible mean?

It means the service implements the Amazon S3 API, so S3 clients, SDKs and tools work by changing the endpoint URL and credentials. Compatibility levels vary, so advanced features like object lock may differ between providers.

Is object storage a replacement for snapshots?

They complement each other. Snapshots capture the whole server for quick rollback, while object storage holds file-level and database backups away from the server, which protects you if the server itself is lost.

Related guides