Storage and Databases
Compare object, block and file storage, understand durability and storage classes, and choose between managed relational and NoSQL databases.
Welcome back!
Step 1 of 13Learn
Three kinds of storage
Cloud providers offer three fundamentally different kinds of storage, and picking the wrong one is a common and expensive mistake.
Block storage works like a virtual hard drive attached to one VM. The operating system formats it with a file system and uses it like a local disk. It's fast and low latency, ideal for operating system disks and databases running on VMs. Examples: Amazon EBS, Azure Managed Disks, Google Persistent Disk. Usually one volume attaches to one VM at a time, and you pay for the size you provision, whether full or empty.
File storage provides a shared network file system that many machines can mount at once, with familiar folders and files. It suits shared content, home directories and legacy apps that expect a network drive. Examples: Amazon EFS, Azure Files, Google Filestore.
Object storage stores data as objects in buckets. Each object is a file plus metadata, addressed by a unique key and retrieved over HTTP(S) through an API, not mounted as a disk. It scales to virtually unlimited size, is cheap per gigabyte and is extremely durable. It's the default for backups, images and videos, static website files, logs and data lakes. Examples: Amazon S3, Azure Blob Storage, Google Cloud Storage. You pay for what you actually store, plus requests and data transferred out.
A useful rule: block for a single server's disk, file for a shared drive, object for everything stored and fetched as whole files at scale.
Step 2 of 13Practice · Sort into groups
Sort each use case by the best storage type.
Tap an item, then tap its group (or drag it there).
Step 3 of 13Compare
Block, file and object storage
| Aspect | Block | File | Object |
|---|---|---|---|
| Acts like | A disk attached to one VM | A shared network drive | A huge bucket of files reached by URL |
| Good for | OS disks, databases | Shared folders for many servers | Photos, backups, logs, static sites |
| Scale | Fixed size you choose | Grows as needed | Practically unlimited |
Step 4 of 13Learn
Durability, availability and storage classes
Two words describe how safe stored data is, and they mean different things.
Durability is the likelihood that data will not be lost. Major object storage services are designed for eleven nines, 99.999999999% durability per year, by keeping copies across multiple devices and usually multiple data centers in a region. At that level, if you stored 10 million objects you might expect to lose one every ten thousand years or so.
Availability is the likelihood you can access data when you want it, typically 99.9% to 99.99% for standard storage. Data can be perfectly durable but temporarily unreachable during an outage.
Durability protects against hardware failure, not against mistakes. If you or an attacker delete a file, the provider faithfully deletes every copy. That's why you still need versioning (keeping earlier versions of objects), backups and access controls.
Storage classes trade access speed and cost:
- Hot / standard: frequently accessed data; highest storage price, cheap to read.
- Cool / infrequent access: data read a few times a year; cheaper storage, a fee per retrieval and often a minimum storage period.
- Archive / cold: data you hope never to need, such as compliance records; very cheap storage, but retrieval can take minutes to hours and costs more.
Lifecycle rules move objects between classes automatically, for example "move logs to cool storage after 30 days and to archive after 180 days, delete after 7 years".
Step 5 of 13Practice · Chart
Storage price by class (made-up prices)
Tap the class for backups you must keep seven years but expect never to read.
Tap the bar that answers the question, then press Check.
Step 6 of 13Practice · True or false
Because object storage is designed for 99.999999999% durability, you don't need backups or versioning for important files.
Step 7 of 13Learn
Managed databases: relational and NoSQL
You can install a database on a VM, but most teams choose a managed database service (PaaS), where the provider handles installation, patching, backups, replication and failover. You get a connection address and focus on your data.
Relational databases (SQL) store data in tables with rows and columns, linked by keys, and queried with SQL. They enforce structure and support transactions, so a bank transfer either fully completes or doesn't happen at all. Popular engines: PostgreSQL, MySQL, SQL Server and Oracle, offered as managed services such as Amazon RDS and Aurora, Azure SQL Database and Google Cloud SQL. Use them for orders, accounts, inventory and anything with clear relationships and a need for strong consistency.
NoSQL databases drop the fixed table structure to gain flexibility and massive scale. Main types:
- Key-value stores: fetch a value by its key very fast, for sessions, caches and shopping carts (Redis, DynamoDB).
- Document databases: store flexible JSON-like documents, for product catalogs and user profiles (MongoDB, Firestore, Cosmos DB).
- Wide-column stores for huge volumes of time series or event data (Cassandra, Bigtable).
- Graph databases for relationships, such as social networks or fraud detection (Neo4j, Neptune).
Data warehouses, such as BigQuery, Redshift and Synapse, are separate services built to analyze very large datasets with SQL for reporting and business intelligence.
Step 8 of 13Practice · Match the pairs
Match each workload to the best-fitting database type.
Tap an answer, then tap the place where it belongs (or drag it there).
- An online store's orders and payments that must never be half-recorded
- User session data looked up by session ID in under a millisecond
- A product catalog where each item has different attributes
- Finding friends-of-friends and suspicious connection patterns
- Analyzing five years of sales across billions of rows for reports
Step 9 of 13Diagram
Families of managed databases
Tap a shape with to see more.
- Managed databases
- Relational (SQL)
Tables, joins, strict consistency.
- NoSQL
Flexible structure, huge scale.
- Orders, accounts, payments
- Key-value
Sessions, shopping carts, caches.
- Document
Product catalogs, user profiles.
- Graph
Social connections, recommendations.
Step 10 of 13Note
Step 11 of 13Practice · Work it out
A company stores 20 TB of backups in standard object storage at a made-up price of $0.023 per GB per month, and could move them to an archive class at $0.002 per GB per month. Using 1 TB = 1,000 GB, how many dollars per month would the move save on storage alone?
Step 12 of 13Practice · True or false
A managed database service still requires the customer to install operating system patches on the database server.
Step 13 of 13Practice · What would you do?
What would you do?
A photo-sharing startup stores all user uploads on a single large block storage volume attached to one VM. It is running out of space, and the VM is a single point of failure. What should they change?
Lesson complete!