Bookmarks

Block storage

Storage in which data is split into fixed-size blocks, and each block is read and written by its own address.

Also: block device, block volume

checked 9 Nov

All terms

Block storage volumes are attached to virtual machines and database servers: the disk looks like an ordinary local one, but lives on the storage system and survives a machine restart. Inside a volume there are no files or folders — only blocks, so the machine itself builds the file structure on top of it.

How it works

The storage and the client agree on a block size — usually 512 bytes or 4 KiB — and then work with addresses: the client asks to “read block № 4 096” and the storage returns exactly that block. The block number is called the logical address — LBA. The block device knows nothing about file names, directories or permissions: the client itself creates a file system (ext4, XFS, NTFS) on top of the volume. This is how even a network volume attached over iSCSI works: to the server it looks like a local disk.

  • 512 bytes — the traditional sector size of disks and a typical block size
  • 4 KiB — the typical block size of modern disks and file systems
  • 8 KiB — the pages in which PostgreSQL stores tables on top of blocks

Because addressing is direct, volume performance is measured in IOPS: databases with random writes fit block volumes particularly well.

How it differs from file and object storage

CriterionBlockFileObject
Unit of accessa block by addressa file by pathan object by key
Who keeps the structurefile system on the clientserver (NFS, SMB)the storage itself
Typical workloadDBMSs, virtual machine disksshared directories, home foldersbackups, static files, archives

File storage serves a ready-made file system over the network, object storage works with objects and their metadata through an API. Block storage sits below both: it provides a raw volume, and the client decides what goes on it — a database or a file system.

Where it is used

Cloud disks of virtual machines: an EBS volume in AWS is attached to an EC2 instance and used like a local hard drive, while managed disks in Azure are block volumes for the same machines. Beyond that — volumes for DBMSs, LUNs in SANs, Ceph block devices (RBD), Kubernetes persistent volumes, RAID arrays. A volume does not care what is stored on it, so the same disk suits both a database and a virtual machine.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • object storage

    Object storage works with objects and metadata through an API, block storage works with blocks by addresses on top of a volume.

  • NASnetwork-attached storage

    A NAS serves ready-made files and directories over the network (NFS, SMB), block storage serves an empty volume that the client formats itself.

In depth in the references

where the topic is covered in detail