r/programming 8d ago

Solving the 1+N Query Problem

https://acadia.engineering/blog/solving-the-1-plus-N-query-problem
131 Upvotes

94 comments sorted by

View all comments

93

u/archipeepees 8d ago

ive been using EF Core for ORM and this hasn't really been a problem for me or any of my colleagues for at least a decade because we don't use lazy loading. database calls are explicit; mapping the results to objects is implicit. is everyone outside of .net still banging their heads against stuff like this?

15

u/andrerav 7d ago

Same here. Been using EF for over 15 years and I can count on one hand the number of times N+1 has shown up. It's so easy to catch as well. Mind-bending to learn from this post how much misinformation and hate there is towards ORMs simply because even seasoned senior devs either aren't competent or using trash tools.

2

u/i_am_bromega 7d ago

Yeah, I’ve had a N+1 problem once with EF, and it was my mistake that was easily fixed. I can understand ORMs may be less than ideal for certain types of systems, but I think they’re great for the vast majority of applications.