Data in a cache is usually stored in fast-access hardware, such as random access memory (RAM) and can also be used in conjunction with a software component. The main objective of the cache is to increase data recovery performance to avoid having to access the underlying storage layer, which is slower. When exchanging capacity for speed, a cache typically stores a subset of data transiently, unlike databases whose elements are usually complete and durable.
If we compare accesses, we have to latency, that is, the time we wait to receive the first data from a memory. The hard drive, this time, is milliseconds (DISK) and in nanosecond (RAM) memories. In this case there are differences of 100,000 times.