Mohakhali, 5:42pm, February
ext. chowrasta. cars idling. one windshield wiper missing.
(A black Toyota sits at the Mohakhali chowrasta. Inside, two men. Fariduddin, who has lived in Dhaka his whole life. Robert, his cousin from Mississauga, in for ten days. The driver's side window is half open. A rickshaw ghosts past on the right with a child asleep on the rear axle. Forty minutes in, nobody has moved more than seven feet.)
ROBERT
"How does anyone get anywhere these days?"
He says it the way a man says it after he has already said it twice and isn't sure whether he is asking a question or filing a complaint with the universe. The wiper that still works clicks once on the dry glass and stops. A CNG to the left honks twice in the slow two tap that means the driver is about to do something stupid, and a moment later he does it.
Fariduddin watches the manoeuvre finish without a scratch.
"It works because nobody is in charge," he says. "I know how that sounds."
Robert looks at the windshield like it owes him an apology. Fariduddin reaches for the lukewarm cha in the cupholder. He has been waiting forty minutes to explain a thing he has been thinking about for fifteen years.
Dhaka traffic is a distributed system, and I mean that technically. There is no global coordinator and no shared clock. Every vehicle holds local state and exchanges messages with its neighbours, and throughput is suspiciously high for a city of 22 million pressed onto the road area of a postage stamp. The protocol is just unfamiliar to anyone who learned to drive in Dortmund.
Every scene that follows is a node in the cast. Click any one of them and the page jumps to that beat, the way a CNG driver picks his next gali by looking at four neighbours and committing rather than waiting for the whole road to agree on a plan.
the article as a graph. each node is a scene.
click any node. read in any order.
Traffic concepts mapped to system concepts
Dhaka traffic
distributed without a coordinator
Honking
gossip protocol
Right of way
local consensus
Rickshaw
unkillable daemon
Traffic warden
leader election
Hartal
network partition
Lane discipline
eventually consistent
CNG meter
stateful with private state
Truck convoy
byzantine fault
The honk is a message
protocol layer. gossip with three opcodes.
(Cut to the bonnet of a CNG, two cars ahead. The driver leans on the horn for half a second, pauses, leans again.)
FARIDUDDIN
What outsiders hear as noise is a gossip protocol with at least three message types. The slow two tap announces "I'm about to do something stupid," broadcast before the manoeuvre. The rapid staccato is the reply, "you're doing something stupid, please stop," sent by anyone close enough to be inconvenienced. The long unbroken lean translates to "yield or die, I have committed," and acknowledgement is implicit, because if nobody slams a brake then consensus has been reached.
Robert tilts his head. He has heard the slow two tap three times in the last minute and not noticed it as language until now.
Right of way is local consensus
paxos at the chowrasta, on a humid schedule.
(Camera pans to the intersection of Mohakhali Road and Wireless Gate. A car, two CNGs, three rickshaws, and a man on a phone call are all converging on the same six square metres.)
Right of way at this intersection is local consensus, not law. The cars and CNGs and rickshaws and the occasional pedestrian on a phone call are running a small Paxos round, and whoever proposes most credibly wins. Credibility is bumper paint plus vehicle mass plus eye contact, and the decision binds only the four or five nodes who happen to be standing in it. The chowrasta two blocks down doesn't need to agree on anything, which is the entire trick.
Leslie Lamport wrote this up in 1978 in Time, Clocks, and the Ordering of Events in a Distributed System. You don't need a global clock. You need a partial ordering and a way to break ties. The tiebreaker on Mohakhali Road is the long honk.
The rickshaw is a daemon
background process. doesn't respond to SIGTERM.
(Slow zoom on a single rickshaw puller in a faded blue shirt. He has been pedalling since 5am. He is 42 and looks 55.)
FARIDUDDIN
"You see him? That one, the rickshaw on the left?"
The rickshaw puller is a background process that does not respond to SIGTERM. Traffic moves around him, the warden waves at him, the car behind honks the rapid staccato. He continues at the speed of a man who has been pedalling since before dawn and has correctly concluded that none of you will physically remove him from the road. He is right about that. Every distributed system has a process like this one, and you route around it rather than try to kill it.
Robert watches the rickshaw thread a gap that a polite driver would have called impossible. He starts laughing the way you laugh when you realise the joke has been on you for a while.
The CNG is a stateful worker
private fee schedule. handshake in three steps.
(Cut to a green CNG idling beside the Toyota. The meter on the dashboard glows red. The driver looks at it with the affection one reserves for a dead houseplant.)
The CNG driver is a stateful worker with a private fee schedule. The meter on the dashboard is decorative, and the actual price gets computed through a handshake that takes three steps, weighing destination, weather, and how desperate you look while standing at the side of the road waving. You will pay more than the meter would have priced, and that markup is how the system has priced in the deception. The fare gets quoted, you counter, he refuses, you walk three steps, he calls you back, and somewhere between the third and the fourth round you have agreed on a number.
The warden, then no warden
leader election by sheer presence.
(Wide shot. A man in a fluorescent vest steps into the middle of Mirpur Road circle, raises one arm. Cars stop without any visible signal having been exchanged.)
Then there is the warden. He arrives around eight in the morning at the Mirpur Road circle, performs leader election by sheer presence, and runs the show for ninety minutes. Then the heat hits, the vest goes back into the booth, and the system loses its leader. For three or four minutes everything is worse, and a Pathao rider yells something unprintable at a Noah van. After that, local consensus takes over and throughput recovers, which is what every Raft cluster does when the leader dies, just on a more humid schedule.
Deadlock at Banani 11
four streams. four locks. nobody yields.
(Establishing shot of Banani Road 11 at half past five on a Tuesday. Four streams of traffic meet. Nobody yields. The horns become orchestral.)
ROBERT
"This is the part where somebody dies, isn't it?"
Classic deadlock shows up most evenings at Banani 11, where four streams meet and each refuses to yield, every node waiting on a resource held by another node, until nothing moves at all for ninety seconds. The only resolution is an external process, usually a man in a fluorescent vest pulling one vehicle out of the wait graph by the bumper. All four Coffman conditions, satisfied on a Tuesday at half past five, witnessed by anyone who has ever cut through Banani after work.
Hartal is a network partition
zones unreachable. each side stays up. merge later.
(Cut to a hartal morning the previous April. Streets are closed off with bricks. A boy on a bicycle peels around the barricade and keeps going, because the protocol on his side of the partition is still running.)
Network partition is what a hartal looks like from inside the system. Streets close, zones become unreachable, riders inside one partition can still talk to each other but not to the other side, and each partition stays up with stale state until things heal. When the barricades come down in the evening, the two halves merge noisily, with rumours about what happened on the other side and a half hour of lane discipline being even worse than usual, eventually consistent, the way Dynamo says it should be.
The Aricha truck convoy
byzantine. didn't read the spec.
(3am, the road empty for the first time. A convoy of fourteen trucks comes in from the Aricha highway, headlights flashing in patterns that mean nothing in any decade of Bangladeshi traffic.)
So we route around them, with a lot of horn.
The software argument
local-first beats global coordination. file under engineering.
(Back inside the Toyota. Traffic has started inching. Robert is no longer looking at the windshield like it owes him an apology.)
FARIDUDDIN
"I'm not making a tourism argument, by the way. I'm making a software one."
We have spent fifteen years assuming good systems need strong coordination, a central database, a single source of truth, a leader, and we pay for it in latency and in the misery of keeping the coordinator alive. Dhaka, running every weekday between Tejgaon and Gulshan, is the proof that local-first protocols can beat global coordination at the scales that matter to most of us. You don't need every car to know every other car's position. Each car needs to know about the four around it and honk competently, and throughput emerges from there.
A polite car yields earlier than necessary and pays a small individual cost so the system pays a smaller global one. That is genuinely a kindness. It is also why the system in Berlin breaks the moment somebody fails to be kind on schedule. Dhaka skips the politeness layer and pays the cost directly with a horn and a forearm out the window, which is uglier and noisier and, on the dimensions Lamport was actually writing about in 1978, demonstrably more resilient. The map of who spoke to whom is the system you are actually running, not the clock on the wall, which was decorative the whole time.
Outsider's reading
Engineer's reading
Build the chowrasta, not Dortmund
closing scene. the light goes green.
(The Toyota begins to move. Slowly, then all at once, the way traffic always begins to move once the deadlock breaks. Streetlights the colour of sodium flicker on in sequence along Mohakhali Road.)
FARIDUDDIN
Build software that needs every node to agree on the time before anything moves, and you have built Dortmund, which is lovely and slow and falls over the moment one node stops answering. Build software where each node knows about the four neighbours nearest to it, gossips with them competently, tolerates the occasional Aricha truck convoy that won't read the spec, and keeps moving when the leader goes home at noon, and you have built something that looks like the Mohakhali junction at half past five on a Tuesday in February. That junction is the system I would rather be running on a bad day.
The light at the chowrasta turns green. The CNG to the left has already started moving on the slow two tap, two seconds before the light, because his protocol stack reads the cars in front of him and not the bulb on the pole. Robert watches it happen and laughs again, quieter this time, and Fariduddin pulls out into the gap behind the CNG without waiting for anyone to tell him it is his turn.