System performance depends on many factors: server load, network throughput, client application response time, and more. Database access can be optimized according to these performance factors.
To optimize the number of database round trips and path length to data, a cache and preload framework enables you to define your working set of data for any task. This working set determines the amount of data that will be retrieved for a given task.
Figure 2. Network round trips are reduced improving performance
When the set of objects you want to retrieve is very large, performance degradation occurs when instantiating the objects all at once. A cache framework prevents this problem by keeping objects in their native format as long as possible.
Figure 3. Caching framework. Using a caching strategy optimizes performance.
The set of data required to perform a task is often known ahead of time, or can be derived from application hints. Minimizing the number of database round trips is achieved by retrieving as much data as possible. The preload framework enables you to tune performance in this manner. One example of this would be joining the relational tables that form a composition tree.
In the diagram below, two Dept objects are retrieved from the database by the application. Other related objects, Emp and Addr are also retrieved and loaded into the cache to be instantiated at a later time, such as when accessed by a user-interface dialog. This eliminates the extra trips to the database to fetch the related objects.
Figure 4. Preload strategy. Loading other objects ahead of time based on derivable data and/or application hints reduces trips to the database.
Support for Static SQL is available as well to reduce server load.