tezvyn:

Block Storage: Your Virtual Hard Drive in the Cloud

AI-drafted, machine-checkedSource: Wikipedia: Block-level storagebeginner

Think of block storage as a raw hard drive in the cloud. It's the foundation for virtual machine disks (like AWS EBS) and databases that need direct control over their storage. The footgun is treating it like a web-accessible file share; it's a raw device.

WHY IT EXISTS Cloud computing needed a way to provide persistent, high-performance disk space for virtual machines. Early cloud storage was often ephemeral or too slow for databases and operating systems. Block storage was created to solve this by emulating the familiar, reliable behavior of a physical hard drive that an application could directly control.

THE MENTAL MODEL Think of block storage as a raw, unformatted SSD that you can virtually plug into a single cloud server. You get a blank slate of a specific size (e.g., 500 GB). It's up to you to format it with a filesystem (like ext4 on Linux or NTFS on Windows) and mount it before your server's operating system can use it to store files. It behaves just like a local disk.

HOW IT WORKS When you request a block volume, the cloud provider's Storage Area Network (SAN) carves out a logical unit of storage for you. This volume is then presented to your virtual machine over the network, typically using a protocol like iSCSI. Your VM's operating system sees it as a raw block device, and can read and write data in fixed-size chunks (blocks). This low-level access is what enables high performance for I/O-intensive applications.

WHEN TO USE IT Use block storage for workloads that require a persistent filesystem with low-latency disk access. It's the standard choice for the boot volume of a virtual machine, for running transactional databases like PostgreSQL or MySQL, or for any application that needs to read and write frequently to a dedicated disk.

WHEN NOT TO USE IT Do not use block storage for data that needs to be accessed by multiple servers simultaneously; for that, you need a distributed file system like NFS or a managed service like AWS EFS. It's also a poor and expensive choice for storing large, static assets like images or videos that need to be served over the web. Object storage (like Amazon S3) is far better suited for that use case.

ONE CANONICAL EXAMPLE Attaching an Elastic Block Store (EBS) volume to an EC2 instance in AWS. You provision a 100 GB volume, attach it to your running instance, and then SSH into the server. Inside the server, you would find a new device (e.g., /dev/sdf), format it with a filesystem, and mount it to a directory like /data. From that point on, anything written to /data is persisted on your EBS volume, even if the EC2 instance is stopped or rebooted.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.