Why this matters
N+1 patterns explode latency and load.
Flag patterns that issue network/database calls inside loops; recommend batching (Promise.all), joins, or aggregate endpoints.
N+1 patterns explode latency and load.
Side-by-side examples engineers can pattern-match during review.
for (const id of ids){ await fetch(`/users/${id}`) }const resps = await Promise.all(ids.map(id=>fetch(`/users/${id}`)));await loop(fetch())await Promise.all(ids.map(fetchUser))From the same buckets as this rule.
Review SQL/database migrations for operations that can lock large tables or cause downtime. Examples: creating indexes without CONCURRENTLY (Postgres), ALTER COLUMN TYPE on big tables, adding NOT NULL without backfill, long-running updates without batching. Require an online migration strategy (CONCURRENTLY, backfill in batches, dual-write/expand-contract) and a rollback plan.