Data for Next.jss
Data in Next.js covers how a page reads and changes information. Server Components can await fetch or a database call directly, and Server Actions let a form or button run a function on the server to write data. Route Handlers expose HTTP endpoints when other clients need an API.
Stage: Data and Caching · Part of the Next.js roadmap · Last reviewed 19 November 2026
What to learn in Data
- Fetch data inside an async Server Component with await
- Run parallel requests with Promise.all to avoid slow request waterfalls
- Write a Server Action that validates form input and updates a record
- Build a Route Handler that returns JSON for a GET or POST request
- Refresh displayed data after a mutation using revalidation
Data interview questions
What is a Server Action in Next.js?
A Server Action is an async function marked with use server that runs on the server but can be called from a form or a client event. It is used for mutations such as saving a record, and it should validate input and check permissions like any endpoint.
How do you avoid a request waterfall when fetching data in Next.js?
Start independent requests together instead of awaiting them one after another, usually with Promise.all. You can also split the page into components that fetch their own data inside Suspense boundaries so slow queries do not block faster parts of the page.
Where Data fits in the Next.js roadmap
Data belongs to the Data and Caching stage (intermediate level), which takes about 16 hours. Fetch what you need.
Other units in this stage
Back to the full Next.js roadmap