creating your API endpoints, you need to write logic to interact with your database
If you are using React Server Components (fetching data on the server), you can skip the API layer, and query your database directly without risking exposing your database secrets to the client
things to be aware of
The data requests are unintentionally blocking each other, creating a Request waterfall
u can start executing all data fetches at the same time, which is faster than waiting for each request to complete in a waterfall
By default, Next.js prerenders routes to improve performance, this is called Static Rendering. So if your data changes, it won’t be reflected in your dashboard