There are many guidelines and patterns for optimizing performance of web applications. I would like to address and confront one of them: minimizing the number of database queries (or web service calls) per request. It sounds like a good heuristic – each network round-trip (e.g. to and from the DB) takes several milliseconds and impacts the overall response time. So having fewer queries is indeed the right approach for many cases. However, I would like to highlight some situations, when better way is to do the opposite.
Read More