Next 15 Data Fetching: Best Practices for a Large App?
Hey everyone, doing a quick sanity check on our data fetching strategy for a large Next.js 15 app in production.
Current Stack: React Query + Server Actions
We're running into a few challenges and would love this community's opinion on the best path forward.
Our Pain Points:
- Error Handling: Errors thrown from our Server Actions are generic ("An error occurred in the Server Components render..."). How are you cleanly surfacing specific errors on the client?
- Scalability: As the app grows, managing query keys and hooks is getting complex. Are there better patterns for keeping this organized at scale?
- Server Actions vs. Route Handlers: Is there a clear winner for mutations when using React Query? The developer experience with errors in Server Actions has been rough.
Our goal is a scalable and reliable data-fetching layer. We're open to migrating off React Query entirely if a more modern or better-integrated solution exists.
What's your take? And if you have any go-to resources (articles, talks, repos) for large-scale Next.js data fetching, please send them our way.
Current Stack: React Query + Server Actions
We're running into a few challenges and would love this community's opinion on the best path forward.
Our Pain Points:
- Error Handling: Errors thrown from our Server Actions are generic ("An error occurred in the Server Components render..."). How are you cleanly surfacing specific errors on the client?
- Scalability: As the app grows, managing query keys and hooks is getting complex. Are there better patterns for keeping this organized at scale?
- Server Actions vs. Route Handlers: Is there a clear winner for mutations when using React Query? The developer experience with errors in Server Actions has been rough.
Our goal is a scalable and reliable data-fetching layer. We're open to migrating off React Query entirely if a more modern or better-integrated solution exists.
What's your take? And if you have any go-to resources (articles, talks, repos) for large-scale Next.js data fetching, please send them our way.
