Hacktakes · Edition 14
Hacktakes · Edition 14 · July 29, 2026

The Brinks Truck Architecture

Decoupling your database across a network is an obsolete practice that needlessly trades the extreme speed of local storage for massive latency.

By Saul Berger

Sparked by SQLite in Production: Optimizing WAL Mode, Concurrency, and VFS Layers · discussion

It takes forty-five minutes to change the channel, but the scalability is phenomenal.
It takes forty-five minutes to change the channel, but the scalability is phenomenal.

Everybody knows that if you are building a "real" web application today, you absolutely must provision a dedicated, distributed PostgreSQL cluster hosted on a completely different continent than your stateless web servers, sitting behind three layers of VPC peering, virtualized load balancers, and a Byzantine microservice mesh just to render a static login page for an enterprise dog-walking app.

Wrong.

(And yes, I hear you shrieking about web-scale failover topologies already. Please, just breathe into a brown paper bag for three minutes, take your allergy medicine, and let the adults talk.)

Why exactly do we do this to ourselves? Every single day, a thousand junior developers dutifully write massive, inscrutable Terraform scripts and paste scrubbed Kubernetes YAML files from Stack Overflow to orchestrate this exact architecture. They sit there in their open-plan offices, nursing lukewarm cold brew, sweating bullets because they are terrified that if they do not entirely decouple their state from their logic, the angry ghost of some 1980s relational database professor will haunt their GitHub repositories and revoke their hacker credibility. Let us briefly look at the actual physics of computing, which, translated into plain English, means looking at how long it takes a handful of electrons to move from point A to point B.

I am constantly amazed by how many extremely smart, obnoxiously well-paid developers will spend three grueling weeks optimizing a single SQL query to shave off a few clock cycles, but completely ignore the massive, self-inflicted physics penalty of placing a physical network wire between their application code and their database. If your application needs to read a tiny row of data from a modern NVMe solid-state drive sitting on the exact same motherboard as the CPU, that operation takes roughly 10 microseconds. In CPU time, 10 microseconds is barely a coffee break. It is practically instantaneous.

But if you have dutifully separated your application server and your database into two different virtualized boxes housed in separate racks, you must cross the network wire. A single intra-datacenter TCP/IP round trip takes about 500 microseconds. (Take a look at the classic latency numbers every programmer should know if you think I am making this up.) To a modern processor, waiting 500 microseconds is like waiting for continental drift. You are voluntarily accepting a 50x physics penalty just to retrieve a single string variable so a user can see their dog's name on a screen.

Making a network hop to fetch a user profile is exactly like deciding you want a slice of Swiss cheese for your turkey sandwich, but instead of just reaching into your own kitchen fridge, you hire a fleet of unionized, armored Brinks trucks. You dispatch a guy named Sully wearing a high-vis vest to fill out federal highway transport permits in triplicate, you sit idling behind a fleet of eighteen-wheelers at two separate Department of Transportation weigh stations, you pay exorbitant toll booth fees, and you finally hire heavily armed guards to carry that single, sweating slice of cheese across state lines to your dining room table.

The actual work—getting the cheese—takes literally zero time. The transport overhead is completely insane.

The TCP/IP protocol stack is the Brinks truck. The three-way network handshake is Sully's highway permit. The JSON serialization is the armed guard. Your little row of user data is the cheese.

So how did we get here? I actually possess deep empathy for the working developers of the late 1990s who originally invented this client-server database architecture. Back then, hard drives were literally spinning platters of rust. They were brutally, agonizingly slow. The physical disk head had to mechanically swing across a metallic platter like a deranged phonograph needle just to find your cheese, which took actual, perceptible milliseconds.

Imagine a side-by-side whiteboard diagram of the architectural bottleneck in 1999 versus 2024. In 1999, you had a relatively fast 100-megabit TCP/IP wire talking to a desperately slow spinning disk. The disk was the ultimate bottleneck. Pulling the database off the application server and putting it onto its own dedicated, monstrously expensive piece of Sun Microsystems hardware made perfect economic sense. That database server cost more than my house and had gigabytes of RAM specifically to cache queries because disk I/O was the ultimate enemy. The Brinks truck made sense back then because your local fridge was padlocked, bolted to the floor, and buried under three feet of solid concrete.

But the modern Architecture Astronauts are still mindlessly copying a twenty-five-year-old deployment diagram. They do not realize that the invention of NVMe SSDs completely inverted the physics of the datacenter. The disk is now exponentially faster than the network wire. The wire is the bottleneck. The cheese truck is now millions of times slower than just reaching into the fridge yourself, yet we have an entire generation of cloud-certified consultants with lanyards around their necks insisting that you absolutely must route your dairy products through a virtual weigh station in US-East-1.

These people spend their days drawing majestic, heavily arrowed diagrams in PowerPoint, designing fault-tolerant distributed networks for applications that will only ever serve about four hundred concurrent users on a good day. They are obsessed with scaling horizontally, completely ignoring the comical fact that a single modern server you can rent for fifty bucks a month can comfortably hold your entire customer database in RAM twice over. It is like designing an industrial suspension bridge to span a puddle in your driveway. You are paying a team of DevOps engineers a zillion dollars a year to manage the complexity of a network that only exists because they built it in the first place.

The pragmatic solution is so incredibly simple that it physically angers cloud vendors who want to charge you by the byte for network egress. Just run a single process talking to a local SQLite file. We are already seeing smart, quiet companies running SQLite in production for low-latency app servers, putting the data on the exact same physical machine as the code.

(Attention, Hacker News concurrency theorists: I do not want to hear a single word about database write locks crippling your massive, imaginary scale, alright? Type your little essay about distributed Raft consensus algorithms into a text file, print it out, and eat it. Write your own column.)

The concept of write locks crippling your read-heavy business is a phantom problem pushed by people who sell network infrastructure. Think about your actual web app. Ninety-nine percent of the time, users are just reading the dog walking schedule, not updating it. If you simply turn on Write-Ahead Logging in SQLite, readers do not block writers. You pair that with PRAGMA synchronous=NORMAL, and you instantly strike the perfect, beautiful pragmatic balance between extreme academic ACID purity and the actual real-world performance required to serve your users.

You bypass the TCP/IP stack entirely. You fire Sully. You sell the Brinks truck. You just reach into the fridge and grab the cheese.

Every time you unnecessarily serialize a basic data request, allocate memory for the buffer, stuff it into an IP packet, compute the checksum, shove it out a network interface card, route it through a virtual software-defined switch, receive it on another virtual interface across the aisle, deserialize the JSON payload, and wait for a remote PostgreSQL thread to wake up from its slumber to parse your SQL, you are throwing away computing power for absolutely no tangible business benefit. You are trading microsecond realities for distributed delusions because someone at a conference wearing a branded fleece told you it was a "best practice."

Baloney.

Unless you are actually building the next Google, stop applying for federal highway permits to move your cheese. Put the database on the exact same machine as your code, turn on WAL mode, and go home by 5 PM. Everything else is commentary.

← Back to Edition 14