Given a web application with high traffic, which loading strategy would you choose to optimize database performance and why?

  • Eager loading
  • Explicit loading
  • Lazy loading
  • No loading
Eager loading would be the preferred choice in this scenario. It retrieves all necessary data upfront, minimizing the number of database round-trips, which is crucial for high-traffic applications to maintain responsiveness. Lazy loading, on the other hand, could lead to N+1 query issues, causing performance bottlenecks. Explicit loading allows for more control but is less efficient than eager loading for high-traffic scenarios. No loading would result in empty or incomplete data, not suitable for a web application.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *