Both the term buffering and caching is related to storage and then access of data, but there are some key difference that makes them different. First let’s see what both these term means and after that we will see the differences.
1. Buffering :
In computer system when the speed in which data is received and the speed in which data is processed are different, then there we use the buffer. Buffer is a memory space which stores the input data and pass it on to the system according to this speed in this way there is no need to hold the input device until it is processed. simply the data will be stored in buffer and the used by the system. The buffer can be of any type, hardware or software, but in general software buffer are used widely.
Example – In printers spoolers, we can pass a large no of pages to print as input, but the processing/printing is slow. Here buffering is used.
2. Caching :
Caching is storing data in a separate disk (very fast speed disk). The data which is to be used many times results in wastage of time if it is in hard disk, but storing the data in cache reduces this time wastage.
Example – Cache is used in system to speed up the access of data frequently used.
Difference between buffering and caching :
|Basic||Buffer stores data till it is processed||Caching fastens the data access speed of repeatedly used data|
|Storage||Buffer stores original data||Bache stores copy of the data.|
|Location||Buffer is a memory space in ram||Cache is in processor, and can be also implemented with ram and disk.|
|Type||Buffer can be hardware as well as software buffer.||Cache is a fast disk and hence it is hardware.|
|Policy||First in First out||Least recently used|
|Behavior||Buffer is in block sizes like 4, 8, 16 so on, i.e, reading a single character will be same as reading the whole block||Read and write is same as the normal storage|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Spooling and Buffering
- Caching Page Tables
- I/O buffering and its Various Techniques
- Difference and Similarities between PHP and C
- Difference between node.js require and ES6 import and export
- Difference between Stop and Wait protocol and Sliding Window protocol
- Similarities and Difference between Java and C++
- Difference between Yaacomo and and XAP
- Difference between VoIP and and POTS
- Difference between ++*p, *p++ and *++p
- Difference Between DOS and Windows
- Difference between User Level thread and Kernel Level thread
- What’s difference between The Internet and The Web ?
- Difference between Priority Inversion and Priority Inheritance
- What’s difference between Linux and Android ?
- What’s difference between header files "stdio.h" and "stdlib.h" ?
- Difference between HTML and HTTP
- Difference between http:// and https://
- What's difference between MMU and MPU?
- What's difference between Microcontroller (µC) and Microprocessor (µP)?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.