System Design · Module 08
Storage engines and on-disk data structures
- Lessons
- 15
- Free
- 0
- Reading
- ~5 h
Your progress
0 / 15 lessons done
Sign in to trackLessons
- Storage engine requirements: what they must handleDatabase settings and benchmarks only make sense against a clear storage contract. You need that contract when choosing an engine, changing durability settings or investigating missing data.
- Storage engine tradeoffs: reads, writes and spaceStorage tuning often moves a cost rather than removing it. You need to recognize when faster writes create slower reads, growing files or maintenance work that cannot keep up.
- Building a key-value store on a single fileStorage libraries turn file operations into promises about data. Building a small store exposes the ordering, recovery rules and resource limits behind those promises.
- Binary file formats: designing your ownStorage files can outlive the program that created them. Engineers need precise byte contracts to read old data, detect damage and deploy compatible changes.
- Append-only logs and BitcaskStorage engines often keep old bytes instead of updating them. Understanding that choice helps you explain their memory use, durability settings, recovery time and background disk traffic.
- LSM trees: storage designed for fast writesA database can accept writes quickly and still become slower every minute. Understanding LSM trees helps you distinguish a short burst of speed from sustainable storage throughput.
- The LSM write path: memtable, WAL and SSTablesAn embedded storage engine can acknowledge a write long before it reaches a sorted data file. Understanding that gap helps you choose durability settings, investigate write stalls and reason about crash recovery.
- The LSM read path: Bloom filters and sparse indexesA database can accept writes quickly yet struggle to find one key. Understanding its read path helps you distinguish excessive file checks, missing metadata and genuine data reads.
- Compaction: merging files and reducing amplificationAn LSM engine can accept writes quickly while accumulating work that later slows reads or stops writes. Compaction connects that background work to disk capacity, deletion correctness and user-visible latency.
- Immutable data files and versioningStorage maintenance must not break requests already reading data. File versioning connects background compaction, crash recovery and safe disk-space reclamation.
- Object storage internals: how S3-style systems workUploads can finish storing bytes without becoming visible, or become visible before their response reaches the client. Understanding these boundaries helps you diagnose missing objects, failed replacements and growing storage bills.
- Object placement: partitioning and metadataStorage capacity is useful only if requests can find the right bytes. Placement and metadata determine whether adding capacity or replacing a failed machine preserves that ability.
- Append-only streams as a storage layerStorage streams let services rebuild indexes, recover state and serve several readers from one recorded history. Their safety depends on what an acknowledgement means and which records remain available.
- Durability: replication and checksumsStorage can return success before bytes reach persistent media. You need to understand acknowledgment, verification and repair before promising that an uploaded file will survive a failure.
- Design: an S3-style object storeUpload services must coordinate large byte transfers with small, atomic metadata changes. This design shows where data becomes visible, what an acknowledgement promises, and how failures affect those promises.
Practise with
Terms this module teaches 49
Open glossaryAppend-only log
A sequence of records where changes are added at the end instead of rewriting earlier records.
Append-only stream
An ordered sequence of stored records extended by adding records rather than changing earlier ones. A separate retention policy may remove old records.
Atomic publication
Making a complete new version visible through one indivisible change to the authoritative reference.
Binary file format
A contract specifying how stored bytes represent fields, record boundaries and supported versions.
Bucket
A named container that groups objects and provides a scope for their keys and access policies.
Byte offset
A position measured in bytes from the beginning of a file or buffer.
Byte order
The order used to store the bytes of a multibyte number.
Compaction debt
Accumulated file-maintenance work that the storage engine has not yet completed.
Durable prefix
A consecutive initial range of log records recoverable under a stated failure model.
Erasure coding
Encoding data into fragments so it can be reconstructed from a sufficient subset of them.
Failure domain
A set of components that can become unavailable together because they share a dependency.
File-set version
An immutable description of the data files used together, including their levels and key ranges.
Hint file
A compact file containing keys and data locations that helps rebuild an in-memory index without reading every value.
Immutable data file
A data file whose contents do not change after the engine finishes writing it.
Keydir
An in-memory hash table that maps each indexed key to the location of its current record in data files.
Leveled compaction
A compaction policy that maintains disjoint file key ranges within each nonzero level by merging overlapping ranges.
LSM tree
A storage structure that batches updates in memory and merges ordered disk components over time.
Manifest
Authoritative metadata recording which data files belong to a storage engine’s committed state.
Materialized view
Stored results prepared for a particular query and derived from other authoritative data.
Memtable
An in-memory structure that holds recent storage-engine mutations before they are flushed to sorted files.
Merge
A storage maintenance process that copies records still needed into replacement files so obsolete input files can be retired.
Object generation
An immutable revision of an object, identified separately from its current name.
Object manifest
An ordered description of the chunks that make up one immutable object generation.
Object namespace
The naming system that maps a bucket and object key to a stored object version.
Orphan file
An abandoned data file that is not referenced by committed metadata or protected active work.
Placement epoch
A version identifier used to distinguish storage ownership assignments and reject obsolete operations.
Placement map
Versioned metadata describing which storage locations should hold each placement unit.
Placement partition
A group of objects assigned and moved together between storage devices or servers.
Point lookup
A read that asks for the value associated with one exact key.
Range scan
A read that visits records in key order within specified bounds.
Read amplification
Extra read work needed to answer a request, reported with an explicit unit and cache condition.
Record framing
Rules that let a reader identify where each stored or transmitted record begins and ends.
Replay
Rebuilding state by applying stored operations in their recorded order.
Scrubbing
Reading stored data on a schedule and verifying its integrity before a customer request needs it.
Segment
One file in a segmented log; an active segment receives appends and a sealed segment no longer changes.
Size-tiered compaction
A compaction policy that merges similarly sized files or runs into larger runs.
Sorted run
A sequence of records ordered by key that can be searched or merged with other ordered sequences.
Space amplification
Occupied storage divided by live logical data size, with the included files stated.
Sparse index
An index that stores selected key boundaries and locations rather than one location for every record.
SSTable
An immutable sorted file of key records, including values or deletion markers, with metadata used to read it.
Storage engine
The part of a database that organizes stored records, retrieves them and manages their persistence and recovery.
Storage record
One encoded unit of information in a storage file, with rules that identify its boundaries and contents.
Storage sequence number
A monotonically increasing position used to order operations within a storage engine.
Stream offset
A position identifying a record within one stream partition, distinct from its byte location or timestamp.
Stream partition
One independently ordered part of a storage stream.
Stream retention
The policy determining which stored stream records remain available and when old records may be removed.
Stream segment
A storage file containing a consecutive range of stream records, with new records written to an active segment.
Version pin
A counted claim that keeps a file-set version and its required files available until the owner releases it.
Write amplification
Storage bytes written divided by application write bytes, using a stated measurement boundary.