Summary
In this chapter, we learned about how to build database models that can help us make our application performant when dealing with data on a large scale. We saw how optimizing a model can be the first stage of optimization, and how it can help us make our application more maintenance-friendly, by reducing coupling across database models. We then moved on to cover how indexes can be useful for making accessing data inside the database faster, by indexing columns that are more frequently accessed.
We later covered one of the important aspects of maintaining the consistency of the database, through the use of transactions.
The final part of the chapter covered data loading techniques, such as lazy loading, eager loading, and no loading, which can help us reduce the time it usually takes to load the data from the database, and process it before it is presented to the user. We also covered a little bit about how the caching of this data at different levels can help to reduce the load from the application and the database, resulting in improved response times from the database, even in situations with a heavy load.