Three records describe one order: a 23-byte fixed-width line, a 23-byte CSV line, and a 45-byte JSON document. For each, name one promise the reader may rely on without checking, and one promise the reader must verify itself.
A format is a set of promises, not a file extension
Start with a cheque. Along its bottom edge runs a line of digits printed in magnetic ink: a routing number, an account number, and a cheque number. Nothing in that line explains itself. It works because the clearing system extracted four promises and wrote them down: one nine-digit group is the routing number and passes a check-digit test; another identifies the account; a third names the cheque; and a reader that finds fewer than three groups may reject the item. The digits are not the format. The promises are.
Consider a boarding pass next. The printed slip carries a passenger name in capitals, a route, a seat, and a two-dimensional barcode whose fields sit at fixed offsets: a fixed character count for the name, a filler character for unused space, and a check digit over the document number. The gate scanner does not trust the printer to behave; it trusts the arithmetic embedded in the barcode. Once again, the contract—not the ink—is doing the work.
A data format is the same kind of object. Every format makes four promises, whether or not its specification states them aloud. First, admissible bytes: which byte sequences may appear, in what order, and with what lengths. Second, structural invariants: what a reader may assume without checking—that a length is truthful, that text is well-formed, that a checksum matches, or that a field is present.
Third comes failure behaviour: what happens when a promise breaks—reject the entire input, skip the damaged record, substitute a default, or leave behaviour undefined. Fourth come growth rules: how the admissible set may expand over time, which additions stay legal, which are detectable, and which quietly corrupt older readers. A file extension promises none of these, and neither does a brand name; those are labels for families of contracts whose members frequently disagree.
To see the difference in raw bytes, encode a single purchase order in two ways. The first is a fixed-width record, exactly 23 bytes long:
WIDGET04 00001220261130The first nine bytes hold the SKU, space-padded to width; the next six hold a zero-padded quantity; the final eight hold the date as YYYYMMDD. This contract is positional: byte 0 always starts the SKU, byte 9 the quantity, and byte 15 the date. A SKU may not contain a space because spaces mean padding, and appending a new column means rewriting the stride of every record ever stored. What the reader buys in return is immediate frame validation—any record shorter than 23 bytes fails before a single field is inspected—though the reader still has to verify that the characters inside each slot are legal digits or SKU bytes.
Now write the same order as a delimited line—also 23 bytes once you include its terminating newline:
WIDGET04,12,2026-11-30Here the contract is separational: commas divide fields, a newline ends the record, and any field containing a comma or embedded newline must be quoted. Nothing in the framing layer constrains how many bytes a field or a record occupies. That buys painless extensibility: a writer can append a fourth column, and an older reader simply ignores it.
The cost surfaces the instant a wire drops bytes. Slice the last four bytes off the fixed-width record and you hold 19 bytes instead of 23; the reader rejects the frame before touching a field. Slice the last four bytes off WIDGET04,12,2026-11-30 before the newline arrives and you get WIDGET04,12,2026-1: both commas remain intact, all three columns are present, and the delimiter parser succeeds without raising a framing error.
Now reorder those same three columns so the numeric quantity sits in the final slot—WIDGET04,2026-11-30,120000 followed by a newline—and drop the last four bytes (000\n). What reaches the reader is WIDGET04,2026-11-30,120. Both commas survive, every field holds a syntactically legal value, and even a schema-aware type check silently ingests a quantity off by a factor of a thousand. Because total record length was never part of the contract, comma-counting cannot detect truncation inside the trailing field.
Even in twenty-three bytes, those two lines have already settled deep architectural questions: positional against separational, fixed against variable, schema-bound against self-describing. In practice, both contracts are everywhere. The fixed-width layout is the direct ancestor of mainframe record files and packed binary structs; the delimited line is CSV.
Encode the same order in JSON—45 bytes—and the contract shifts a third time. Field names travel alongside their values, strings are escaped rather than comma-quoted, and a grammatical envelope replaces both fixed length and bare delimiters. Drop the last few bytes off a JSON object and you leave an unclosed quote or brace, forcing the parser to fail loudly instead of parsing short—even though the application must still verify types, ranges, and required keys on its own.
The productive question is never which format is better in the abstract. It is which promises your reader actually relies on, and which promises your writer is prepared to keep.
Three Encodings of One Order — and What a 4-Byte Wire Drop Does to Each
Same purchase order (WIDGET04, qty 12, date 2026-11-30), three different contracts.
IN-PAYLOAD COLLISIONS Space inside SKU breaks Fixed-width padding · Unquoted comma inside SKU shifts CSV columns · JSON escapes both inside quotes.
.csv, .json, .bin) promises none of these — only the contract does.
Principle · InsightA format is the set of assumptions a reader is allowed to skip checking. The more it promises, the heavier the writer's obligation; the less it promises, the more each reader invents its own dialect.
Four axes describe any format you will meet
Take a library's shelf list. For decades it lived on catalogue cards with fixed zones—author, title, date, call number—each starting at a known position on the card. A clerk could locate the publication year without reading the title because position carried the meaning. Compare that with a laboratory notebook: entries run in prose, dates appear wherever the researcher wrote them, and you must parse the language to extract a single fact. Both are records; they simply occupy different points on the same design axes.
The first axis is text against binary. Text buys human legibility, clean diffs, and universal command-line tooling; it pays in byte count and parsing ambiguity. Binary buys compact density and unambiguous field widths; it pays in opacity and the requirement to ship a decoder everywhere the bytes are read.
The second axis is fixed against variable. Fixed-width fields buy constant-time indexing—field k starts at a computable byte offset—along with cheap validation by length. They pay in wasted padding bytes and brittle schema evolution. Variable-length fields reclaim that space, paying instead in length prefixes, delimiters, and the scanning work both imply.
The third axis is delimited against framed. A delimiter reserves a byte pattern that cannot appear raw in the payload without escaping; framing attaches an explicit length or type header that announces where each record ends. Delimited formats are easy to author by hand and treacherous to parse cleanly. Framed formats are effortless for machines to skip and parse, yet awkward to edit raw.
The fourth axis is schema-bound against self-describing. In a schema-bound format, the bytes carry only values and the reader must already know the layout out of band. In a self-describing format, names or type tags ride inside the bytes so an unfamiliar reader can still make sense of them. Schema-bound layouts buy density and strict validation; self-describing layouts buy reach.
The decisive property of these four axes is that they are independent. Binary does not imply schema-bound: PNG chunks, CBOR, and MessagePack are all binary formats that embed type tags or field names directly in the payload. Conversely, text does not imply self-describing: a fixed-width text line or a headerless CSV carries zero field names and is every bit as schema-bound as a C struct. A format is a coordinate, not a camp.
Read together, those four coordinates predict almost everything that will hurt later. Fixed and positional means inserting a column breaks every existing reader. Delimited means payload bytes can collide with separators unless escaped. Schema-bound means the schema never disappears—it simply migrates out of the file and into every reader's build.
Self-describing carries a subtler price governed by amortisation granularity: tagging one multi-megabyte compressed block once costs four bytes total, whereas repeating field names on every single row across ten million records burns hundreds of megabytes.
Familiar formats occupy all four corners of this plane. On the text side, CSV sits at text, variable, delimited, and weakly self-describing (only when an optional header row is present), holding our purchase order in 23 bytes at the cost of delimiter fragility. JSON sits at text, variable, delimited by grammar, and self-describing: every 45-byte record repeats "sku", "qty", and "on" in ASCII so any language can inspect it without an external schema. CSV and JSON are nearest neighbours—sharing three of four axes—and diverge most sharply on whether layout metadata travels with every row.
On the binary side, PNG occupies the self-describing corner: binary, variable, framed, and self-describing by chunk type. Each block announces its byte length and a four-letter name such as IHDR or IDAT, amortising a four-byte label across kilobytes or megabytes of pixel data so an older decoder can safely skip chunks it does not understand.
Protocol Buffers sits across from PNG in the schema-bound binary corner: binary, variable, framed, and schema-bound. None of the ASCII field names ("sku", "qty", "on") ever touch the wire. Instead, each value is prefixed only by a compact integer field number and a wire type, telling the decoder whether a varint or a length-prefixed byte slice follows so unknown field numbers can be skipped cleanly.
That coordinate shrinks our 45-byte JSON order to 17 bytes (0A 08 "WIDGET04" | 10 0C | 18 8A D2 D4 09), compared with 22 bytes for a generic tag-length-value record or 14 bytes for a raw packed binary struct. The space saving is real, and so is the trade: without the external .proto schema mapping field 1 to SKU, field 2 to quantity, and field 3 to date, those 17 bytes are three anonymous numbered values. Moving from JSON to Protocol Buffers never erases schemas—it relocates them from the wire into every producer and consumer. Each corner solves a coherent constraint, and becomes the wrong answer the moment that constraint moves.
Four Independent Axes — and Where the 310 MB Actually Went
Binary does not imply schema-bound; text does not imply self-describing. Every move relocates complexity.
57 49 44 47 45 54 30 34
sku (8 B ASCII)
0C 00
qty (u16 LE = 12)
0A 29 35 01
date (u32 LE = 20261130)
0A 08 57 49 44 47 45 54 30 34
field #1 len-delim (sku)
10 0C
field #2 varint 12
18 8A D2 D4 09
field #3 varint 20261130
Amortisation granularity: Tagging a single 4 MB PNG IDAT chunk once costs 4 bytes total (0.0001%). Repeating "sku", "qty", and "on" across 10,000,000 JSON rows costs 250 MB (55.6% of the file). Self-description is cheap per large block and punishing per tiny row.
Principle · InsightBecause these four axes are independent, 'binary versus text' is never a single decision—it is four decisions disguised as one. Naming all four stops one preference from silently settling the others.
The axes you did not name are the ones that decide
A printed railway timetable and a live departure board carry the same facts under opposite policies. The timetable is eager: every train and every stop is resolved at press time. The departure board is lazy: it resolves only the next departures from a feed that may still change. A faxed signature and a notarised copy divide along a second seam—one is lossy, the other exact. You already reason this way about paper documents; the same discipline governs bytes.
Canonical against permissive. A canonical format admits exactly one byte string for each logical value; a permissive format admits many spellings and asks readers to treat them as equal. Canonical encoding buys deterministic hashes, verifiable signatures, content deduplication, and plain byte-equality checks—at the cost of strict encoder discipline. Permissive encoding tolerates diverse serializers, sacrificing the guarantee that two equal values produce identical bytes.
Eager against lazy. Eager decoding materialises the entire input into an in-memory object tree before the caller touches a field: simple control flow, no random access, and memory proportional to input size. Lazy decoding leaves bytes in place and resolves fields on demand, trading startup speed and random access for the obligation to validate—or trust—every access as it happens.
Exact against lossy. Exact formats preserve every distinction the writer encoded. Lossy formats discard information irreversibly—acceptable when a human eye or ear is the final consumer, poisonous when the bytes feed arithmetic or a cryptographic signature.
Human against machine. Human-first text stays debuggable, greppable, and diffable, but requires escaping rules, grammar parsing, and a character encoding. Machine-first binary is compact and fixed in width, yet opaque without a decoder or a hex dump.
Wire against storage. A wire format models transit: one message at a time, streaming forward, with no indexes. A storage format answers for disk pages, crash durability, and finding one record among billions. The same logical data routinely requires both, and the two encodings rarely look alike.
None of these axes acts in isolation. Canonical versus permissive is empty until you specify exactly what is canonicalised, and eager versus lazy is largely a decoder policy rather than a property stamped into the file. When a format advertises a single headline virtue—"human-readable", "compact", "fast"—it is telling you which axis it wants you to inspect first, and which ones it would rather leave unnamed.
Place real formats on these five axes and familiar production bugs stop looking mysterious. JSON is text, permissive, eager in most parsers, lossy for large integers (values above 2^53 lose precision once decoded into IEEE 754 doubles), and human-first. Engineers routinely try to make JSON signable by sorting object keys alphabetically and stripping whitespace—and still watch signature checks fail across services in production.
The culprit is permissive text's hidden degrees of freedom. 1, 1.0, 1e0, and -0.0 all parse to the same number; "\u0061" and "a" (like "\/" and "/") decode to the same string; Unicode characters can arrive in composed (NFC) or decomposed (NFD) form; and a single trailing newline scrambles every bit of a SHA-256 digest. Until every spelling rule is pinned identically across every language runtime, a hash signs a serializer's dialect, not the underlying value.
DER—Distinguished Encoding Rules, from ASN.1—sits at the opposite pole: binary, canonical, eager, exact within its type system, and machine-first. By admitting strictly one binary byte sequence per value, DER eliminates decimal formatting and whitespace ambiguity altogether, which is why X.509 certificates and content-addressed protocols such as deterministic CBOR sign canonical binary profiles rather than permissive text. A gzip archive occupies a third spot: exact about its decompressed content yet permissive about its wire bytes, since embedded timestamps, header flags, and compressor choices allow the same file compressed twice to yield different hashes.
The decision procedure is to name the deciding axis before arguing over brands. "Should we use JSON or binary?" has no principled answer. "Do we need exactly one byte string per value so signatures verify across independent runtimes?" has a crisp answer—and settles half the candidate list immediately.
Six Spellings of One JSON Value — Six Unrelated SHA-256 Digests
Every row below parses to the identical object (a=1, b=2). Change one byte of spelling and roughly half of all 256 digest bits flip.
| Spelling & Wire Bytes | SHA-256 Digest (first 64b bold) | 64-Bit XOR vs A | Hamming Diff |
|---|---|---|---|
|
A · Canonical
13 B
{"a":1,"b":2}
|
43258cff783fe7036d8a43033f830adfc60ec037382473548ac742b888292777
|
0 / 256 baseline | |
|
B · Swapped keys
13 B
{"b":2,"a":1}
|
3fb75453225c732a76b7899ea2096dda1455189c89817239732182f73fe5a09f
|
131 / 256 51.2% flipped | |
|
C · Pretty spaces
18 B
{ "a": 1, "b": 2 }
|
dff00ea25fe8c50e7aa5c8990614ad8f4ede53b61b821eb029993ada4a58aca3
|
122 / 256 47.7% flipped | |
|
D · Trailing \n
14 B
{"a":1,"b":2}\n
|
e8d38819d39f705646bfb643368eca78f7db476c16471dbc33b941b27326410d
|
129 / 256 50.4% flipped | |
|
E · Float 1.0
15 B
{"a":1.0,"b":2}
|
3a5fc11441293773f44e7207ddf4783fdcfc50b78e63e3e484cfcbfe61a8508c
|
116 / 256 45.3% flipped | |
|
F · Unicode \u0061
18 B
{"\u0061":1,"b":2}
|
d59d2dc570dbbd6d4d7afa4afdc3a9f24cf4c5425dc68038b377f570757dbd57
|
119 / 256 46.5% flipped |
ASN.1 BER vs DER (X.690): BER permits multiple byte spellings per value; X.509 certificates sign DER because one value maps to exactly one byte sequence.
Principle · InsightA hash is a statement about bytes, never about meaning. To make it testify about meaning, you must collapse every equivalent spelling into one—and that collapse is a design decision, not a library call.
Read a format as a position, not a precedent
A street address is a position: a house number tells you where to look without walking the block. A library shelf mark works the same way—823.914 SMI locates a volume without scanning the stacks because the coordinate scheme, not the neighbouring books, defines its place. Directions, by contrast, are precedents: "the third house past the church" works only from one starting point, and "the book after the atlas" breaks the moment a clerk reshelves a volume. Data formats are addresses. Reading one as a precedent—"do what the winner shipped"—copies a solution stripped of its problem.
Read PNG as a set of coordinates. It is binary, big-endian, chunk-framed, self-describing by chunk type, lossless, parse-on-read, and used on both wire and disk. None of those is a virtue in isolation; each buys one capability and pays a specific bill. Binary buys pixel density; big-endian pins one byte order across CPU architectures; chunk framing enables skipping and resynchronisation; self-describing chunk types allow safe extension; lossless preserves exact pixels; and parse-on-read tolerates compression and unaligned payloads at the cost of CPU on every access.
Its eight-byte file signature is the clearest miniature portrait of design-as-position:
89 50 4E 47 0D 0A 1A 0AThe leading byte, 0x89, has its high bit set so any 7-bit channel that strips bit 7 corrupts the signature visibly. The next three bytes spell ASCII PNG for anyone inspecting a dump. The 0D 0A pair catches transfers that translate DOS CRLF line endings to Unix LF. Byte 0x1A halts a DOS TYPE command from spewing binary noise across a terminal, and the final 0x0A detects Unix-to-DOS LF expansion. Not a single byte is decoration; each is a concrete bet against a transmission failure the designers expected to meet.
Immediately at offset 8 begins the first chunk, IHDR: a four-byte length, a four-byte type, thirteen bytes of image metadata, and a four-byte CRC-32 covering type and data. That twelve-byte envelope is a deliberate framing bet. Any decoder that understands the envelope can skip an unknown chunk in O(1) time—stepping cleanly past length, type, payload, and checksum without interpreting a byte inside—while a mangled signature still causes rejection within the first eight bytes.
Every framing bet also draws a trust boundary. A four-byte length prefix is an untrusted claim until the reader bounds it against both the remaining file size and a hard memory limit. If an attacker sends a 64-byte file whose chunk length reads 0xFFFFFFFF (4 GB) and a naive reader allocates or seeks blindly, O(1) chunk skipping collapses immediately into memory exhaustion or an out-of-bounds read.
The trailing CRC-32 marks a second boundary: it defends against accidental transmission bit-flips, never against a deliberate adversary. Anyone who alters the payload bytes can trivially recompute a matching CRC-32 trailer. Integrity against channel noise is a checksum's job; authenticity against tampering requires a cryptographic MAC or signature.
Now read a Git object the same way. Its uncompressed bytes carry a minimal header—"blob", a space, the decimal byte count (such as blob 12), and a NUL byte—followed by the file content, then zlib-deflated for disk storage. Object identity is the hash of the uncompressed header plus content. Its coordinates: binary on disk, minimally self-describing (the header names the object type), canonical enough for content addressing, storage-oriented, and parse-on-read because the reader must inflate before hashing. The NUL terminates the header; the decimal length gives the reader a bound it can check.
Set both beside an older ancestor at the opposite corner of the design space. ASN.1 is binary, tag-length-value, and schema-bound, pairing one abstract syntax with multiple concrete wire encodings—BER, CER, and DER. That coordinate bought extraordinary generality across telecommunications and security protocols, yet paid in a specification surface so wide that compliant implementations routinely disagreed. None of these formats is a template to imitate blindly. Each is a coordinate you can locate—and its location predicts exactly which workloads it will serve.
The First 33 Bytes of a PNG — Every Byte Answers a Threat
A 1920×1080 8-bit RGBA PNG header laid flat. Read the bytes as deliberate coordinates, not historic precedent.
ID = SHA-1(all 20 uncompressed bytes) = 3b18e512dba79e4c8300dd08aeb37f8e728b8dad-
01Shape
Self-describing or schema-bound? Fixed layout, tagged fields, or length-framed chunks?
Read the opening 32 bytes for a magic signature, version coordinate, and whether sizes live inline (PNG chunks, Git ASCII length) or in an external schema.
-
02Atomicity
What survives a crash mid-write?
Whole-file temp-and-rename (PNG, Git, safetensors) or an append-only log with an explicit commit marker? A checksum alone never guarantees crash recovery.
-
03Random Access
Can a reader jump to record k without scanning bytes
0..k−1?Look for a header offset table (safetensors
O(1)) or chunk length chains (PNG skip). Outer stream compression (Git zlib) forces sequential inflate first. -
04Canonical Form
Does one logical value map to one exact byte sequence?
Mandatory whenever bytes are hashed or signed (Git uncompressed blob). Key ordering, padding, whitespace, and gap rules decide whether two writers match.
-
05Concurrency
Single writer, immutable object, or multi-writer coordination?
Content-addressed immutable files (Git objects) need zero read locks; mutable containers require external locks, snapshots, or copy-on-write replacement.
-
06Trust Boundary
What breaks when an attacker controls every byte?
Validate every length prefix and offset against remaining bytes and memory limits before allocating. Checksums catch random noise; authenticity demands a MAC or signature.
Principle · InsightA format becomes legible the moment you can state what it bought and what it paid in the same sentence. If you can recite only what it is, you have memorised a precedent, not read a position.
Local best practice is a global trap
A factory standardises on inches because its machines were milled in inches. A city lays tram tracks at the gauge of the fleet it already owns. Both choices are locally rational and globally expensive: the bill arrives years later when a new machine, supplier, or connecting line turns up. Data formats accumulate the exact same sediment.
Teams walk into that trap in three predictable ways. The first is designing for the demo, where the only constraint visible is the one in the README and every operational constraint arrives as an incident. The second is copying the winner's accidents—adopting a ubiquitous format and inheriting its number semantics, escaping rules, and evolution limits without inheriting the environment that made them cheap. The third is picking tools before naming constraints: choosing a library first and letting its default format silently dictate durability, framing, and schema policy.
The way out is arithmetic, not taste. Write down the workload: records per second, bytes per record, retention horizon, reader population, read frequency, and what must never be lost. Then multiply. You do not need a benchmark to learn that 45 bytes per row and 14 bytes per row differ by a factor of three; you need one multiplication.
Run the numbers for a single sensor logging once per second for five years (ignoring leap days): 157,680,000 rows. At 45 bytes per row, the archive consumes 7.1 GB; at 14 bytes per row, it shrinks to 2.2 GB. The packed encoding is 3.21 times smaller—a 69% reduction. That ratio is a mathematical property of the encoding, completely independent of hardware.
Whether a 69% reduction should drive your architecture depends entirely on the binding constraint. Across 10,000 internal configuration rows, the exact same ratio saves just 310 KB (0.45 MB versus 0.14 MB)—invisible on any modern disk or link—while charging you schema distribution, cross-language decoders, and the ability to inspect or diff a broken config at 2 AM.
Now scale that identical 1 Hz logger across 50,000 cellular field sensors. The exact same 3.21x ratio drops five-year volume from 354.8 TB down to 110.4 TB, saving 244 TB of storage and radio battery life. Nothing about either encoding changed; the binding constraint simply flipped from engineer-hours to bandwidth and energy.
The reason JSON keeps winning in small and medium systems is not that engineers stopped caring about bytes. It is that the global constraint is coordination: parsers already exist in every runtime, a human can open and diff the file in a text editor, and onboarding a new consumer takes minutes rather than a schema negotiation. That is a real engineering advantage, priced in engineer-hours instead of gigabytes. The mistake is never choosing JSON; the mistake is believing you chose it for its bytes, or quoting a percentage reduction without multiplying it by your actual row count.
Before importing any best practice, restate the constraint it was built to solve. "Always use text" solved debugging and universal tooling in a world of modest record counts. "Always use binary" solved bandwidth and footprint in a world of controlled readers. Neither rule travels safely without its world.
Same 3.21× Ratio Across Ten Orders of Magnitude — Where the Binding Constraint Flips
Packing cuts 45 B/row to 14 B/row (−68.9%) at every scale. Whether that ratio should decide your format depends on what dominates the bill.
- JSON (45 B)
- 0.45 MB
- TLV (22 B)
- 0.22 MB
- Packed (14 B)
- 0.14 MB
- Saved
- −310 KB (−68.9%)
Pick JSON/CSV — engineer-hours dominate; 310 KB is invisible.
- JSON (45 B)
- 7.10 GB
- TLV (22 B)
- 3.47 GB
- Packed (14 B)
- 2.21 GB
- Saved
- −4.89 GB (−68.9%)
Inflection — TLV/Protobuf (3.47 GB) trades size for evolution.
- JSON (45 B)
- 354.8 TB
- TLV (22 B)
- 173.4 TB
- Packed (14 B)
- 110.4 TB
- Saved
- −244.4 TB (−68.9%)
Pick framed binary — radio battery & storage dominate.
- External schema & version registry — every packed reader must hold the exact layout version.
- Cross-language decoder maintenance — each runtime pays a permanent parsing & test bill.
- 2 AM incident inspection in year six — no human can open or
greppacked bytes in an editor.
Principle · InsightBest practice is a local solution to someone else's constraint. Before you import it, restate the constraint it solved and verify that you actually share it.
The zero-copy bet that won its argument and lost the market
Cap'n Proto set out to eliminate the parse step: the wire buffer is the in-memory object graph, fields sit at fixed offsets, and a reader follows pointers without copying or decoding. It delivered exactly that—yet adoption stayed narrow, leaving the format a textbook reference for a trade-off rather than an industry default. The costs it accepted were real: larger padded messages, a rigid layout, schema-coupled evolution, and an ergonomics bill paid by every caller. Systems optimising for wire density, untrusted inputs, or loose schema flexibility went elsewhere. Nothing crashed; the loss was the opportunity cost of perfecting a local optimum.
A format succeeds by fitting its adopters' binding constraints, not by winning on elegance. Zero-copy is a bet on read-heavy, trusted, memory-mappable data; most systems face untrusted boundaries, transform payloads, and copy anyway.
Five Drills to Lock the Axes In
Every drill grades your reasoning against concrete architectural checkpoints. Missed points return targeted clues — never verbatim answer dumps — alongside why each check is suggested in practice.
Place CSV, JSON, PNG and Protocol Buffers on four axes: text/binary, fixed/variable, delimited/framed, schema-bound/self-describing. Which pair is closest, and on which axis do they differ most?
A team signs JSON documents by hashing the bytes. Their encoder emits object keys in insertion order and includes a trailing newline only when the writer's template happens to end with one. Predict what breaks when a second service verifies the signature, and name the property the format is missing.
Design a format for 200-byte sensor readings taken once per second for eight years in the field. Readers are low-power devices that sometimes need only the timestamp and sometimes the whole reading. State your position on fixed/variable, schema-bound/self-describing, and parse-on-read/zero-copy, and name the cost you accept.
A team cuts its storage by about 40% by moving a 10-million-row table from CSV to a packed binary record. Six months later analysts cannot inspect files, a new field is needed, and one downstream team has no decoder. Predict the two costs that were not in the byte count, and name one design change that would have reduced both.
Get Part 02 by email.
Next in this series: Byte Craft—what a single byte can promise, alignment walls, endianness, and framing invariants. One illustrated dispatch when it finishes; no filler, no third-party trackers.
Write straight to Femi.
Spotted a corner case in one of the five exhibits, disagreed with a drill checkpoint, or want to discuss wire format architecture for your stack? Email goes straight to me.