We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
This idea carries a full system design question on its own. Each walks through the full answer.
System Design Masterclass · Database Types Storage
Free preview: the first part of this 17-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Database Types Storage
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Picture an old hardware shop. Behind the counter there is a wall of small wooden drawers, floor to ceiling. Every drawer is the same size. Every drawer has a number. There are a few thousand of them.
You walk in and say, "Drawer 2,317, please." The shopkeeper does not start at drawer 1 and open each one to look inside. She knows the wall is laid out in order, so she counts across and down in her head, walks straight to drawer 2,317 and pulls it open. It takes her the same few seconds whether you ask for drawer 12 or drawer 3,900.
Now notice what the shopkeeper does not know. She does not know what the screws in drawer 2,317 are for. She does not know that drawers 2,317, 2,318 and 40 together hold the parts for one kitchen cabinet. That knowledge lives in the notebook of the carpenter who rents those drawers. The shop only promises one thing: give me a number, and I will open that exact drawer, fast.

Every drawer is the same size and has a number, so the shopkeeper can go straight to any one of them. What the contents mean is someone else's business, written in someone else's notebook.
That wall of drawers is a very good picture of block storage: storage cut into numbered, same-size pieces with no names, where something on top decides what each piece means. The pieces are called blocks. The computer says "read block 4,812" or "write this data into block 4,812", and the device does exactly that. It does not know what a file is. It does not know what a database table is. It keeps no names at all. Something above it keeps the notebook that says which blocks belong to what. That something is usually a filesystem, the part of the computer that turns blocks into named files and folders (more on it soon), or a database, a program that stores records such as customers and orders.
In this lesson I answer three questions: what is block storage, why do databases want it, and how is it different from file storage and object storage. I show you real block storage examples: the solid-state drive in your laptop, a disk you rent in Amazon's cloud (called an EBS volume), and the fast drive built into a rented cloud computer. I show the published speed limits from Amazon Web Services (AWS) and Microsoft Azure, two big cloud companies. Then you run a small lab, a short program you can try yourself, that turns an ordinary file into a pretend disk and measures it. Near the end I size a database disk by hand, with every step of the arithmetic shown.