$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT

Block Storage

Block storage presents a disk as a long array of fixed-size blocks (usually 4 KiB), each addressed by a number called a logical block address (LBA). The device knows nothing about files, folders or owners; it only answers “read block 1,040” and “write these bytes to block 1,040”. The operating system puts a file system (ext4, XFS, NTFS) on top to turn those blocks into files. A laptop SSD, an Amazon EBS volume, a Ceph RBD image and a SAN LUN are all block storage; they differ in where the blocks physically live.

The path of one write

$ pg_ctl start # PostgreSQL on an EBS volume
From write() to replicated blocks
APPLICATION PostgreSQL, writing an 8 KiB page FILE SYSTEM ext4 / XFS: names, folders, permissions BLOCK DEVICE /dev/nvme1n1: numbered 4 KiB blocks NETWORK VOLUME EBS / Ceph RBD, on storage servers write(orders_file, 8 KiB, offset 57344) file offset 57344 → blocks 1040–1041 WRITE LBA 1040, 2 blocks copies in the zone → ack SERVER A SERVER B fsync ✓
  1. Four layers sit between a database and the physical media. Only the top two know what a file is.
  2. PostgreSQL asks to overwrite 8 KiB at offset 57344 of a data file. It changes just that page, not the whole file.
  3. The file system looks up which blocks hold that part of the file: blocks 1040 and 1041.
  4. The block device receives a plain "write 2 blocks at LBA 1040". No names, no folders, just addresses.
  5. On a cloud volume the blocks travel over the network and are replicated to several servers in the same zone before the write is acknowledged. Now fsync returns and the commit is durable.

This is why databases want block storage: they need small, in-place, low-latency writes and a guarantee (fsync) that a write survived. Object storage cannot overwrite 8 KiB in the middle of an object.

Kinds of block storage

Kind Examples Latency Survives instance loss? Notes
Local NVMe SSD EC2 instance store, bare-metal disks ~0.1 ms No Fastest, but data dies with the machine. Good for caches, scratch space, replicated systems like Kafka or ClickHouse.
Cloud network volume Amazon EBS (gp3, io2), Google Persistent Disk / Hyperdisk, Azure Managed Disks ~0.5–1 ms Yes Replicated inside one availability zone. Pay for provisioned size, IOPS and throughput. Snapshots go to object storage.
Software-defined Ceph RBD, Longhorn, OpenEBS ~1 ms Yes Self-hosted replicated volumes, common for Kubernetes and OpenStack.
SAN iSCSI, Fibre Channel, NVMe over Fabrics arrays sub-ms Yes Traditional enterprise data centers.

In Kubernetes, block volumes appear as PersistentVolumes with access mode ReadWriteOnce: one node mounts them at a time.

Performance terms

  • IOPS: operations per second. Matters for databases doing many small random reads and writes.
  • Throughput: MB/s. Matters for sequential scans, backups, Kafka segments.
  • Latency: time per operation. Network volumes add roughly half a millisecond over local NVMe.
  • On EBS gp3 you set IOPS and throughput independently of size; io2 Block Express targets consistent sub-millisecond latency for large databases.

What block storage is not

  • Not shareable by default. Two machines mounting the same ext4 volume at once will corrupt it. Shared access needs a cluster file system or a file/object service. (EBS Multi-Attach exists for io1/io2 but requires a cluster-aware file system.)
  • Not cross-zone. An EBS volume lives in one availability zone. Zone-level durability comes from snapshots or database replication.
  • Not HDFS. HDFS splits files into 128 MB “blocks”, but it is a distributed file system accessed through its own API, not block storage.

Common mistakes

  • Running a production database on instance-store NVMe without replication, then losing the data when the instance stops.
  • Sizing a volume for capacity only and hitting the IOPS or throughput limit under load.
  • Forgetting that a snapshot of a running database is only crash-consistent; use the database’s own backup tooling or freeze I/O first.

Learning Resources