database query in every single react component?
Im’ quite new to full stack development (coming from UX design). I’m asking in the direction of software design and database query strategies.
Quick example: Imagine you have a database with booking for a service including customer info and start and end date for a booking. Now there are two components: first is listing customer information for each booking and second component is a visualization of booked period. Would you prefer to make one database query in the parent component and pass the information into the component or rather do a single query within each of these components? One single query for all needed information or rather multiple queries with just the right amount of needed information? I have no experience in any delay issues of one or the other solution. Lets assume there are maximum 500 booking results from a query.
Hope you can help me