As we have been talking about different ways of optimizing database queries it reminded me of different ways to optimize application performance when it comes to returning data to the application tier. There are two schools of thought with different strategies. Some applications retrieve data on demand, a lazy load approach. Others may choose to use a approach, retrieving lots of data at one time.
These methodologies are not mutually exclusive. Any application may use one or the other, or use them both. Angular works really nice with chunky loaded data simply because much of the MVC implementation is in the browser. It has local cache for populating the user experience, and through data binding can perform CRUD operations of smaller sets of data as needed.
One way I have seen chunky load be effective is to upload reference table data up front. Then it is cached in the browser for every user experience, and doesn’t need to be uploaded again. Of course this has problems. It only works if the reference data is static. Because the values are cached, you are going to have to handle refreshing of the data when it becomes stale. Also, because you are uploading the reference data all at once, you have to get it all, because you don’t know what you will need. Contrast that with uploading lookup data along with specific screens. When you load data in that fashion, then you only upload lookup data relevant to the area in which the user is working. While you will upload the same data multiple times, you won’t have caching issues, or upload data in which the user has no interest.
As you can see, chunky load doesn’t fit any and every application. In fact, it is more targeted for those situations where the data is static, or you need a lot of data in order for the user to perform their work. There are some great examples of chunky load available on Google. If you think you may have an application that benefits from ing, take a look at some examples. I would suggest you put together a small implementation to become familiar with how it works before making a commitment to this method.
Cheers,
Ben