Block Storage Explained
Table of Contents + −
Here’s a question that sounds simple but trips people up. When a database or a virtual server saves your data, what is it actually saving it onto?
- Like, you run MySQL on a server in the cloud. It writes rows, it reads them back, all day long.
- But that server doesn’t have a physical hard drive you can hold in your hand.
- So where does the data actually go? Onto something called block storage.
In this lesson we’ll figure out what block storage is, how it works, and why almost every database and virtual machine sits on top of it. We’ll keep it beginner-correct, so it’s simple but not wrong.
🧱 What is Block Storage
Let’s start with the name itself, because the name tells you most of the story.
- Block storage is raw storage that’s cut up into small, equal-sized chunks. Each chunk is called a block.
- A block is just a fixed-size slot for data, often something like 512 bytes or 4 kilobytes. Every block is the same size, like identical boxes on a shelf.
- Each block gets an address, a number. So the system can jump straight to block number 5,000 and read or write it, without reading everything before it.
Now here’s the part that confuses beginners, so let’s say it clearly.
- Block storage by itself doesn’t know about files or folders. It only knows about numbered blocks. It’s “raw”.
- It behaves like a bare hard drive you just plugged in. Empty, no structure, nothing on it yet.
- To make it usable, the operating system puts a filesystem on top. A filesystem is the software that organizes those raw blocks into files and folders you can actually open. (Think NTFS on Windows, or ext4 on Linux.)
So block storage gives you the empty disk. The filesystem gives you the files. Two different layers, and that’s an important distinction.
⚙️ How It Works
Okay so how does this actually get used by a server? It happens through something called a volume.
- A volume is one chunk of block storage that you create and treat as a single disk. Like, “give me a 100 GB volume” gets you one virtual disk of that size.
- You then attach that volume to a server. Attaching means connecting it so the server sees it as its own disk, just like plugging a drive into your laptop.
- Once attached, the operating system reads and writes individual blocks on that volume whenever a program needs data.
Here’s the flow you should picture in your head.
A couple of things make this special, and they’re the whole reason people reach for block storage.
- It’s very low latency. Latency is the small delay between asking for data and getting it back. With block storage that delay is tiny, because the disk behaves like it’s right there inside the machine.
- The server can read or write any block directly, in any order. It doesn’t have to go through a slow web request for each piece of data.
So the mental model is simple. A volume is a disk, it’s attached to one server, and the server pokes at blocks directly. Fast and direct.
⚡ Why It’s Used
Now why would you choose block storage over other options? It comes down to how it lets you touch the data.
- It’s fast and low latency, so the data comes back almost instantly. That matters a lot when a program is reading and writing constantly.
- It supports random access. Random access means jumping straight to any block you want, instead of reading from the start every time. So a database can grab one specific row in the middle without scanning the whole disk.
- It allows in-place edits. You can change just a few bytes inside a block and leave the rest alone. You don’t have to rewrite a whole file to update one small thing.
Because of those traits, block storage is the natural home for certain workloads.
- Databases like MySQL and PostgreSQL. They do tons of small, scattered reads and writes, so they need that fast random access.
- Virtual machines. The whole disk of a VM, including its operating system, usually lives on a block volume.
- Boot disks. The disk a server starts up from is block storage, because the OS needs direct, fast access to it from the very first second.
When block storage is the right call
If something writes and reads data constantly, in small pieces, and in no particular order, block storage is usually the answer. Databases and VM disks are the classic examples. The data feels like it’s sitting right inside the machine.
⚠️ The Limits
Block storage is great, but it’s not magic. It comes with real trade-offs you have to know about.
- It’s usually attached to one server at a time. This is called single-attach. So you can’t easily have ten servers all writing to the same volume at once, the way you can with other storage types.
- It doesn’t scale as massively or as cheaply as object storage. Storing petabytes of photos on block volumes would get expensive and awkward fast.
- It has no built-in web access. You can’t just hit a volume with an HTTP link from a browser. A program has to go through the operating system and the filesystem to reach the data.
So block storage is fast and direct, but it stays tied to one machine and it’s not the cheap bucket you dump endless files into. That’s what object storage is for, which brings us to the comparison.
⚖️ Block vs Object Storage
These two get mixed up a lot, so let’s put them side by side. Object storage keeps whole files as “objects” in a flat pool, and each one gets a web address you can fetch over HTTP. Block storage, as we saw, hands you a raw disk.
| Aspect | Block Storage | Object Storage |
|---|---|---|
| What you get | A raw disk (volume) split into blocks | A bucket holding whole files as objects |
| How you reach it | Attached to a server, via the OS | Over HTTP, with a URL |
| Edits | In-place, change a few bytes | Replace the whole object |
| Latency | Very low, feels local | Higher, it’s a web request |
| Scale and cost | Limited, pricier per GB | Huge, very cheap per GB |
| Best for | Databases, VM disks, boot disks | Photos, videos, backups, files |
The one-line takeaway. Use block storage when a program needs a fast disk it can edit constantly, and object storage when you just need to store lots of whole files cheaply.
🌍 Real Examples
Let’s make this concrete with things you’ll actually see in the wild.
- Amazon EBS. EBS stands for Elastic Block Store, and it’s the most famous example of cloud block storage. You create a volume, attach it to an EC2 server (Amazon’s virtual machines), and it shows up as a disk.
- A VM’s disk. Any virtual machine you start, on AWS, Google Cloud, or Azure, gets its system disk from block storage. That’s where its operating system and programs live.
- Running a database. Say Alex deploys PostgreSQL in the cloud. The database files sit on a block volume, so every query reads and writes blocks fast, with that low latency we talked about.
EBS in one line
Amazon EBS is block storage you rent in the cloud. You make a volume, attach it to one server, and it acts exactly like a hard drive that server owns. When you read about EBS in interviews or AWS docs, that’s all it is.
⚠️ Common Mistakes and Misconceptions
A few ideas trip people up here. Let’s clear them out one by one.
- “Block storage is accessed over HTTP like S3.” Nope. There’s no built-in web URL. A program reaches it through the operating system and a filesystem, because it’s a disk, not a website.
- “Just use object storage for your database.” Bad idea. Object storage means replacing whole objects and dealing with higher latency, so a database doing constant small edits would crawl. Databases want block storage.
- “Block storage and file storage are the same thing.” They’re not. Block storage hands you raw blocks and you add your own filesystem. File storage already gives you a shared folder structure, ready to use, that many servers can mount at once.
- “A volume can be shared by many servers freely.” Usually not. Block volumes are typically single-attach, tied to one server at a time. If you need many servers sharing data, you’re looking at file or object storage.
🛠️ Design Challenge
Try this one yourself to test what stuck.
Imagine you’re designing storage for a photo-sharing app. You’ve got two kinds of data:
- The actual photo files that users upload and view.
- The database that tracks users, likes, and comments.
Decide which storage type fits each one, and say why. For example:
- The photos are whole files, viewed over the web, and there are tons of them. Which storage is cheap and HTTP-friendly for that?
- The database does constant small reads and writes and needs low latency. Which storage gives it a fast, editable disk?
Work out the answer in your own words. Picking the right storage for each job is exactly the kind of reasoning a system design interview is looking for.
🧩 What You’ve Learned
You can now explain what block storage is and when to reach for it. Here’s the recap.
- ✅ Block storage is raw storage split into fixed-size blocks, each with its own address.
- ✅ A volume is block storage you attach to a server, where it acts like a hard drive.
- ✅ The operating system adds a filesystem on top to turn raw blocks into files and folders.
- ✅ It’s very low latency and supports random access and in-place edits, which makes it perfect for databases, VMs, and boot disks.
- ✅ It’s usually single-attach and doesn’t scale as cheaply as object storage, with no built-in HTTP access.
- ✅ Amazon EBS is the classic real-world example of cloud block storage.
Check Your Knowledge
Test what you learned. Pick an answer for each question, then click Check.
- 1
What is block storage?
Why: Block storage is raw storage split into fixed-size, numbered blocks that a server sees as a disk (a volume).
- 2
Who turns the raw blocks into files and folders you can open?
Why: Block storage only knows numbered blocks; the operating system adds a filesystem on top to organize them into files and folders.
- 3
Why is block storage a good fit for databases?
Why: Databases do lots of small, random, in-place reads and writes, which block storage handles fast thanks to low latency and direct block access.
- 4
Can many servers usually share one block volume at the same time?
Why: Block volumes are typically single-attach; for sharing across many servers you reach for file or object storage instead.
🚀 What’s Next?
Block storage is one of three storage styles you’ll keep meeting in system design. Now go see how the other two compare.
- File Storage Explained shows how shared folders let many servers mount the same data at once.
- Object Storage Explained breaks down the cheap, web-friendly buckets that hold photos, videos, and backups at huge scale.
Once you’ve got all three in your head, choosing the right storage for any design becomes second nature.