Mutating Data & Revalidation
Learn how Server Actions can mutate data on the server and automatically revalidate cached data to update the UI.
What is Data Mutation?
In web development, data mutation means changing data on the server. This includes creating new data, updating existing records, or deleting data.
- Create: Adding a new user.
- Update: Changing a user's email.
- Delete: Removing an item from a list.
Most interactive web applications rely heavily on data mutation to provide dynamic experiences.
Server Actions for Mutations
Next.js 15's Server Actions are perfect for handling data mutations. They allow you to run server-side code directly from your React components, making it simple to update your backend.
Instead of creating API routes for every data change, you can define these actions right where they're needed, keeping your code organized and efficient.
All lessons in this course
- Basic Server Action Forms
- Mutating Data & Revalidation
- Error Handling in Actions
- Optimistic UI and Pending States with Server Actions