Guideschevron_rightStorage

Storage · 6 min read · Updated

Object vs Block vs File Storage

Block storage is a raw disk: a server formats it with a file system and uses it as a local drive, which is what operating systems and databases need. File storage is a shared folder reached over a network protocol such as SFTP, SMB or NFS, with folders, permissions and file names. Object storage keeps whole files (objects) in buckets and is reached over an HTTP API, usually the S3 API: it scales without limits and suits backups, media and application uploads, but cannot edit part of a file in place.

Side by Side

Block, file and object storage compared
AspectBlockFileObject
What you getA raw diskA folder tree on another machineBuckets of whole files
How you reach itAttached to one serverSFTP, SMB, NFSHTTP API (S3)
Edit part of a fileYesYesNo: you replace the whole object
Shared between serversUsually no (one server at a time)YesYes, from anywhere
Good forOperating systems, databases, appsBackups over SSH, shared files, home foldersBackups, media, app uploads, static files
ExamplesA VPS's own diskA storage boxS3 and S3-compatible buckets

Block Storage

Block storage presents numbered blocks and nothing else. The server's operating system puts a file system on it (ext4, XFS, ZFS) and from then on it behaves like a local disk, with the lowest latency of the three. That is why operating systems and databases run on it. The usual limit is that one block device belongs to one server at a time.

File Storage

File storage is a file system on another machine, shared over the network. You get folders, file names and permissions, and you can open a file and change one part of it. Protocols differ: SMB and NFS are common on local networks, while SFTP and rsync over SSH are the usual way to reach file storage across the internet. A storage box is file storage reached over SSH.

Object Storage

Object storage drops the folder tree. Each object is a whole file plus metadata, stored under a key in a bucket, and you upload, download, list and delete objects through an HTTP API. Names can contain slashes, so they look like folders, but there is no real directory structure and no way to rewrite a few bytes in the middle: changing an object means uploading it again.

In return it scales to any size, can be reached from anywhere with a key, and works with every tool that speaks the S3 API, from the AWS CLI to rclone, restic and application SDKs. Using object storage shows the settings.

How to Choose

  • Running an operating system, a database or anything that edits files in place: block storage.
  • Backups with rsync or Borg, or a folder shared over SSH: file storage, such as a storage box.
  • Backups with restic or Kopia, files your application uploads, media and archives: object storage.

The two remote options are compared in more detail, including how restores differ, in storage box vs object storage.

Amazon S3 and AWS are trademarks of their respective owners. Virteche is not affiliated with or endorsed by them. Details about their products come from their public documentation as of the date at the top of this guide.

Common Questions

  • Is Amazon S3 object storage?

    Yes. S3 is the best-known object storage service, and its API has become the standard: "S3-compatible" storage from other providers accepts the same requests, so tools written for S3 work with it after changing the endpoint and keys.

  • Can I mount object storage as a drive?

    Yes, with tools such as rclone mount, which make a bucket look like a folder. It works well for reading and copying files, but applications that edit files in place or rely on file locking are better served by block or file storage.

  • Can I run a database on object storage?

    Not directly. Databases need block storage, because they rewrite small parts of their files constantly. Object storage is where database backups go: dump the database and upload the file.

  • Which kind of storage is a VPS disk?

    Block storage. The server's operating system formats it with a file system and uses it like a local drive. On Virteche Cloud each VPS has a local NVMe disk.

S3-compatible object storage for backups and app files, and storage boxes for SFTP and rsync, both at a flat monthly price.

See object storage

Keep Reading

All guides
Object vs Block vs File Storage | Virteche Cloud