Granularity mismatch
Granularity mismatch creates amplification.
What it is
To get a low price per bit, you must spread the mechanism's cost over as many bits as possible. This is called amortization. But bits that share one mechanism must be operated on together — that is what "sharing" means. And "operated on together" is the definition of coarse granularity.
- One tape head serves kilometers of ribbon: cheapest per TB, but reading means winding the spool.
- One disk arm serves 20 TB: cheap, but random access means physically moving the arm.
- One flash erase circuit serves a block of 4–24 MB: cheap, but you cannot erase less than a block.
- One HTTP request serves one object in cloud storage: cheap, but you cannot change less than a whole object.
The price ladder and the granularity ladder are the same ladder. You get cheapness by accepting coarseness.
So when you later read about write amplification in flash, zone rewrites in SMR disks, and the small-files problem in object storage, remember: they are not four problems. They are one problem at four price points.
From Physical Substrate & Performance Laws › The dial and the fixed cost
Granularity mismatch creates amplification. Granularity is the smallest piece a mechanism handles. If the unit you have does not match the unit the substrate wants, you pay a multiplier (an amplification). Inside one machine: writing 4 KB into a flash block that can only be erased as 256 KB. Here: a 200-byte record sent in a 1,500-byte network packet, or one row written into a 128 MB file.
From Data Movement › The epistemic limit
Where it appears
In 24 mechanisms. Each says what the mechanism is about, then how this principle shows up there, in its own words.
- Physical Substrate & Performance Laws
Why do trade-offs exist at all?
Coherence works per line, not per byte, because tracking per byte would need 64× more bookkeeping (Cause 2 again).
Read it inCPU and memory: the machine is a guessing machineSeven root causes: why trade-offs exist at all
- Data Movement
How do records cross between two systems that have independent rates, independent availability and independent lifetimes, and what are you willing to lose when the assumption underneath the crossing breaks?
Granularity mismatch creates amplification.
Read it inWhat changed: the epistemic limitTwo kinds of skew: different problems, different fixes
- Storage: Physical Organization
What should sit next to what, given that I must decide at write time and find out at read time?
Alignment costs nothing when you do it, and costs a factor of two to four when you do not.
Read it inThe cost of one accessData at rest and the one ratioPartitions, buckets, row groups and zone maps
- Persistence & Durability
When a system says "yes, your data is safe", what exactly has it promised, and what did it have to do to keep that promise?
A WAL is a granularity-and-locality transform.
Read it inWrite-ahead logging (redo)Torn pages and double-write buffers
- Core Data Structures
How do we choose a data structure when the real cost is set by the hardware, not by Big-O?
When the size of what you want differs from the unit the machine handles, extra work appears (amplification).
Read it inB-trees and B+trees
- Encoding, Serialization & Compression
What do we turn our values into when we turn them into bytes, and what does that choice cost?
The derivation with the most practical consequence is this one: the redundancy a codec can find is bounded by min(window, block).
Read it inGeneral-purpose compression: the last passBit packing, front coding, nulls and floats
- Transactions & Concurrency Control
What happens when many users change the same data at the same time, and how do we keep the result correct?
Too fine costs metadata; too coarse costs false sharing; there is no setting that avoids both.
Read it inLock granularity and intention locksOptimistic commit on a metadata logA frame for placing any mechanism
- Consistency & Isolation Models
When many users, many objects and many copies exist at once, which histories does the system promise never to show, and who writes the code for the histories it does show?
That is the mismatch rule at work (the unit tracked, a table, differs from the unit needed, a row), and it sets the false-abort rate of serializable snapshot isolation (SSI).
Read it inAn isolation level is a set of forbidden cyclesWrite skew, and the exact boundary of snapshot isolation
- Query Processing
Why can one question be answered by plans whose costs differ by a factor of ten thousand, and what does each operator force the engine to do?
This is the granularity mismatch principle in a form that is easy to miss.
- Query Planning & Optimization
How does a system choose a plan for a question when the facts that decide the best plan are unknown until the plan has run?
This is a recurring pattern: the unit of data reduction is almost never chosen by the data-reduction mechanism.
Read it inFile, row-group and page skippingLate materialization and sampling
- Memory & Resource Management
Who is allowed to hold how much memory, for how long, and what happens to the work when the answer is less than it asked for?
The granularity of a failure determines its blast radius, and the OS's granularity is the process.
Read it inUnspillable state and the kill decisionColumnar memory pooling (Arrow-style buffers)Admission control by memory footprintMemory grants and reservations
- Caching
What happens when we deliberately keep a second copy of data that no protocol forces to be correct?
Hit rate is divided by the number of distinct principals.
Read it inResult caching: the key is the query plus everything it reads that is not data
- Distributed Systems Coordination
Who is allowed to decide, and how does everyone else learn the decision without asking?
No partitioning function separates a key from itself.
Read it inPartitioning and the partition count
- Fault Tolerance & Delivery Semantics
What is the cheapest thing that can be safely done twice?
Coarsening the atomicity unit from "record" to "batch" shrinks the bookkeeping by the batch size.
Read it inEpochs and sequence numbers: one number instead of a dedup setCheckpoints and lineage: save the state or the recipeTask re-execution and blacklisting
- Scheduling & Workload Management
Which work runs now, which work waits, and who pays for the waiting?
> A guarantee is only as quick as the grain at which resources are handed back.
Read it inFair and capacity schedulingHeterogeneous resource matching
- Cost Mechanics
What is metered, and what is the smallest increment you are charged for?
Granularity mismatch generates amplification whether the granularity is imposed by physics or by a contract clause.
Read it inChatty requests, needless recompute and cross-region callsThe computable value of pruningMinimums, labour and the price trajectoryMetadata and control-plane operations
- Streaming
What does it cost to remember, when the input never ends?
Partitioning by key buys lock-free correctness, and costs you the ability to ever split a key.
Read it inKeyBy and key groupsKeyed state, operator state and the indivisible keyStreaming removes the end
- Change Data Capture & Incremental Processing
What does it cost to know what changed, and is that cheaper than not needing to know?
Detection granularity and application granularity are independent choices.
Read it inThe application granularity ladderPolling and the completeness gap
- Table & Storage Maintenance
Who pays for the gap between the order data arrives in and the order it is read in: the writer, every reader, or a background job, and what is the break-even?
This is a product, not a function of data volume.
Read it inOptimal file size: it is F divided by bWhy small files appearManifest rewriting and orphan filesRetention and legal hold
- Data Modeling
What does one row mean, who is allowed to change that answer, and what breaks downstream when they do?
This is the granularity-mismatch law: the change is one row, the stored copies are millions.
Read it inOne Big TableHierarchiesNested and repeated modelingAs-was or as-is: the slowly changing dimension types
- Metadata, Catalog & Lineage
What can a system prove about its data without reading the data, and how does it know that proof is still true?
One file written means one metadata write, and the fixed cost of that metadata write is far greater than the marginal cost of the file.
Read it inMetastore mechanismsTags, classification and sensitivity labelsOwnership and stewardship
- Orchestration & Workflow
How do you make unreliable, unobservable, irreversible side effects behave like a pure function of a time interval?
Four separate concerns collapse into one arbitrary decision.
Read it inOrchestration moves nothing
- Observability & Operations
What is the smallest description of a running system from which we can find a fault, fast enough to matter, at a cost we can still pay while the system is failing?
Labels must be bounded and enumerable before the code runs.
Read it inCardinality and the four signals
- Specialized Processing Models
What do you build when a query predicate cannot be reduced to a range over an ordered key?
When indexed objects have extent, a partition must either duplicate the object or abandon disjointness.
Read it inFilter-and-refine and spatial partitioningSeries identity and the cardinality wallNothing can be eliminated by inspection
Related
Made on the same pages most often.