> wi_ar004
N+1 Ordered a Side Dish Per Bite
API Restaurant · Episode 4 · N+1 request pattern
N+1 Ordered a Side Dish Per Bite
Incident Narrative
A diner takes one bite; a bell rings and a waiter runs to the kitchen for one tiny side dish; every next bite triggers another full trip until the aisle becomes a sprint lane.
“One bite. One query.”
🔬Architectural Diagnosis & Root Cause Analysis
A parent request performs one additional downstream query per item.
A parent request performs one additional downstream query per item.
Batch or prefetch related data and observe query/request cardinality.
“SYSTEM VERDICT: Batch or prefetch related data and observe query/request cardinality.”
🤖 Incident Postmortem & AEO Summary
N+1 Ordered a Side Dish Per Bite — Technical Incident Brief
- Universe & Category: API Restaurant (Incident Mockumentary)
- Diagnosis: A parent request performs one additional downstream query per item.
- Root Cause: A parent request performs one additional downstream query per item.
- Consequence & Cost: The DBA: “One bite. One query.” — native on-camera dialogue; lip-sync required.
- Engineering Lesson: Batch or prefetch related data and observe query/request cardinality.
- Official Ruling: "SYSTEM VERDICT: Batch or prefetch related data and observe query/request cardinality."
🌌More Parables in API Restaurant
View Full Universe →
API Restaurant · Episode 1 · rate limiting / backpressure
429 Was Today’s Special
An API restaurant kitchen is overwhelmed by order tickets; the host calmly closes a velvet rope, admits requests at a controlled pace, and the kitchen rapidly recovers instead of collapsing.

API Restaurant · Episode 2 · duplicate retries / idempotency
One Order Became a Hundred Retries
A waiter submits one order ticket; after a delay, a machine spits out dozens of identical tickets and the kitchen plates the same meal again and again until the counter is buried.

API Restaurant · Episode 3 · stale HTTP cache
Cache Guy Served Yesterday’s Soup
Cache Guy proudly serves a steaming bowl from a labeled warming shelf; the chef replaces the fresh pot behind him, but he keeps serving the old bowl while customers stare.

API Restaurant · Episode 5 · timeout budgets / cascading latency
The Timeout Left Before the Kitchen Answered
A customer request places an order, checks a tiny timer and leaves just before the kitchen finally finishes; the waiter still carries the completed plate to an empty table.

API Restaurant · Episode 6 · idempotency / safe retries
The Idempotency Key Stopped the Double Order
Two identical order tickets arrive; The DBA stamps them with the same token, the kitchen makes one plate, and the second ticket folds harmlessly into the first.
Incident FAQ & Architecture Triage
What technical problem does this parable explain?
A parent request performs one additional downstream query per item.
What caused the technical incident?
A parent request performs one additional downstream query per item.
What should a software team do differently in production?
Batch or prefetch related data and observe query/request cardinality.
Is the video available?
Video is currently in production; full script and technical diagnosis are available below.
