The case

The product photos lived on the VM's disk. The VM went down and took the photos with it.

Isaac kept the catalog's product photos and the database backups on the disk of the same VM that runs the store. As the catalog grew, the disk filled up on a Sunday, and the store went offline.

To make things worse, the backups were on the same disk they were supposed to protect.

This post builds on Virtual Machines and Regions and Zones.

The problem

One disk isn't enough

Keeping everything on the VM's disk works at the start, and fails in three ways:

  • Space: the disk has a fixed size, and the store grows faster than it does.
  • Dependency: the data is tied to that VM. If it is deleted, or if the zone where it runs fails, the risk is losing everything.
  • Sharing: a second server can't read the photos on the first server's disk.

The solution

Block, file and object

All three store bytes. What changes is how you access those bytes.

Block storage (block storage)

A virtual disk that you attach to a VM and format like any other disk. Fast, with low latency, and usually attached to one VM at a time.

In the store: the disk where the orders database runs.

File storage (file storage)

Folders and files shared over the network. Several VMs mount the same file system and read and write at the same time.

In the store: the folder with the invoice templates, used by all the servers.

Object storage (object storage)

Each file becomes an object inside a bucket, with an address on the internet. It grows without a practical limit and costs little per gigabyte.

In the store: the catalog photos and the backups.

The name in each cloud

The concepts apply to any provider. Only the products change:

TypeAWSAzureGoogle CloudOracle Cloud
Block (block)EBSManaged DisksPersistent DiskBlock Volume
File (file)EFSAzure FilesFilestoreFile Storage
Object (object)S3Blob StorageCloud StorageObject Storage

Inside an object

Each object brings together the content, a name that is unique within the bucket and metadata (file type, date, tags). You read and write through an API, using the same protocol as the web, and you don't mount the bucket as if it were a disk.

Don't mix them up

File × object

Both store files, and that's where exams trip people up. The difference is in how you work with them.

File storage (file storage)

“Do several VMs need to edit the same files, like in a shared folder?”

Example
A group of servers that read and write in the same reports folder.
Focus
Folder hierarchy, access by mounting and editing parts of a file.

Object storage (object storage)

“Do I need to store a huge number of files and deliver them over the internet?”

Example
The catalog photos, opened by an address.
Focus
Flat structure, access by API and replacement of the whole object.

The cost

Cost and durability

Object storage has classes, which trade the price of storing for the price of accessing:

  • Frequent (hot): for what is accessed every day. Storing costs more, and accessing is cheap.
  • Infrequent (cool): for what is accessed once a month, for example.
  • Archive (archive): for backups and records that almost no one opens. Storing costs very little, but retrieving takes time and costs more.

Providers give each class their own names, and the billing rules differ from one to another.

Another number that comes up in exams is durability: the chance of not losing the data. In the standard classes of object storage, the main providers advertise 99.999999999% (the "eleven nines"), because they keep copies in more than one place. That is different from availability, which measures whether the data is accessible right now.

In practice

How to choose

If you…Choose
Need a fast disk for the VM, for the system or for a databaseBlock (block)
Want a shared folder that several VMs read and writeFile (file)
Store photos, videos, backups or logs, in a volume that only growsObject (object)
Store backups that will almost never be readObject (object), in the archive class (archive)

Key terms

Six terms to remember

Tap a card to see the definition.

ArchitectureFinancial

Quick test

Three questions, exam style

01

A VM runs a database and needs a disk with low latency. Which storage fits?

02

The store keeps millions of product photos, delivered by URL, and the volume only grows. Which storage should it choose?

03

Several servers need to read and write the same files at the same time, like in a shared folder. Which one should they choose?


The exam question about storage is usually the same: which type fits this situation? Block is the VM's disk, file is the shared folder, and object is the large, cheap depot that is reachable by URL. Choosing the right type avoids Isaac's problem, with data and backups stuck to the disk of a single machine. The next step on the track is Cloud Networking.