Site icon Sherman On Software

Four Patterns Of Data Loading

There are two main questions to consider when loading data from a database or other external system:

  1. Should I load the data at the start, or when I need it?
  2. Once I have the data, should I save it for reuse?

The answers to these questions give you the four patterns of data loading:

  1. Lazy Load – Load as needed, don’t reuse
  2. Pre-Fetch – Load at the beginning, don’t reuse
  3. Read Through Cache – Load as needed, save the results for reuse
  4. Pre-Cache – Load all the data at the beginning

Each pattern has pros and cons:

Picking the right, or wrong, pattern for you use case can have major performance and scaling implications.

These are the main questions to ask yourself:

Exit mobile version