4 ms·
There is a solution engineered specifically for avoiding N+1 queries and overfetching: GraphQL. More specifically a GraphQL-native columnar database such as Dg
by cluckindan 1y ago
There is a solution engineered specifically for avoiding N+1 queries and overfetching: GraphQL.
More specifically a GraphQL-native columnar database such as Dgraph, which can leverage the query to optimize fetching and joining.
Or, you could simply use a CRUD model 1:1 with your database schema and optimize top-level resolvers yourself where actually needed.
Prisma can also work, but is more susceptible to N+1 if the db adapter layer does separate queries instead of joining.