one sec…Loading projects… 0%
RUENMessage ↗
← All posts
  • 1 min
  • #backend

DataLoader and the N+1 problem

Draft post about DataLoader.

Before

// 1 + N queries
for (const p of profiles) await prisma.skill.findMany({ where: { profileId: p.id } })

After

// 5 queries for any request
loader.load(id)
Next post: StichOS from the inside