Reducing Database Round Trips
Learn to reduce database round trips.
We'll cover the following...
A database round trip is a request from the web API to the database. Database round trips are expensive. The greater the distance between the web API and the database, the more expensive the round trip is. So, we want to keep the trips from the web API to the database to a minimum in order to gain maximum performance.
We will start this section by understanding the N+1 problem and experiencing how it negatively impacts performance. We will then learn how to execute multiple queries in a single database round trip.
Understanding the N+1 problem
The N+1 problem is a classic query problem where there is ...