Computer memory is limited.
When the data size is large enough, the applications need the secondary storage such as hard disks to store the data.
An Example
If the data size is small, the data can be simply stored in memory.
For example, the following program is compiled and executes successfully:
The Problem
If the memory is not able to hold all the data, the traditional data structures can not be used because they assume all data is in the memory.
The following program does not pass the compilation because of not enough memory:
Solutions
There are two ways to solve the above problem by storing the data in files or databases. Partial data is moved to the memory when requested.