Data Buffer - Buffer Versus Cache

Buffer Versus Cache

A cache often also acts as a buffer, and vice versa. However, cache operates on the premise that the same data will be read from it multiple times, that written data will soon be read, or that there is a good chance of multiple reads or writes to combine to form a single larger block. Its sole purpose is to reduce accesses to the underlying slower storage. Cache is also usually an abstraction layer that is designed to be invisible.

A 'Disk Cache' or 'File Cache' keeps statistics on the data contained within it and commits data within a time-out period in write-back modes. A buffer does none of this.

A buffer is primarily used for input, output, and sometimes very temporary storage of data that is either en route between other media or data that may be modified in a non-sequential manner before it is written (or read) in a sequential manner.

Good examples include:

  • The BUFFERS command/statement in CONFIG.SYS of DOS.
  • The buffer between a serial port (UART) and a MODEM. The COM port speed may be 38400 bit/s while the MODEM may only have a 14400 bit/s carrier.
  • The integrated buffer on a Hard Disk Drive, Printer or other piece of hardware.
  • The Framebuffer on a video card.

Read more about this topic:  Data Buffer