Prefetching retrieves data before an application requests it. The aim is to overlap a slow read with other work so the data is ready when needed. It hides access latency rather than making the read itself faster. Unlike replication or caching, it need not rely on managing multiple copies of data. section 11.2
Fetch during authentication
When a user logs in, fetch likely user-specific data in parallel with authentication. If the prediction is right, the application can respond immediately after login instead of starting those reads then. section 11.1
Choose a predictor that fits the access pattern:
- Pattern-based prefetching uses regular access: successive records, nearby records, or records at a fixed stride. It can exploit physical proximity without understanding what the user intends. section 11.2.1
- Semantic prefetching uses current actions or business logic to anticipate an application-specific next request. section 11.2
- Machine learning can identify less obvious relationships between accesses and adapt predictions as workloads change. section 11.2
For sequential processing, request upcoming elements while processing the current one. If the dataset exceeds memory, keep a resident prefetch window and tune its size so upcoming data is available without fetching too far ahead. section 11.2.1
Figure 11.1 With sequential prefetching, we predict that successive data elements relative to the one we’re accessing will be needed in the future. In this example, we access the first data element and, therefore, predict that the next data elements will also be needed.
The diagram shows an access to the first element triggering retrieval of the next two before they are processed. section 11.2.1
Start with a read whose latency matters, predict when and what to fetch, then initiate the read early enough for its result to be useful. Check the cost of wrong predictions: fetching unwanted data wastes resources, while fetching the wrong data leaves the needed read on the critical path. An overly conservative strategy misses opportunities; an overly aggressive one can worsen latency. section 11.1 section 11.2


