In an introductory programming class, I had a professor who explained CPU cache as sitting in a library and having the book in front of you. RAM was like going to a bookshelf. And hitting the hard drive was like ordering it from a store and waiting for it to come.
While those numbers aren't exactly accurate, it does communicate the importance of keeping your data as close to the processor as possible. I recently came across an interesting study by Diomidis Spinellis that shows the relative speeds of different types of memory.
If you have small chunks of data, the latency difference is huge. L1 cache is roughly 55,000 times faster than the hard drive. If you're dealing with sustained throughput, hitting L1 cache is 283.9 times faster than going to the hard drive.
Draw your own conclusions here, but keep this in mind when you're writing apps. (Note that the cost of memory is a bit outdated in this chart.)