What is cache, buffer?
Cache is an optimization technique that is in memory when "read" Data .
A buffer is an area of memory that takes up a process's data cache, such as a Web service, when the user first requests it, the process takes the data (the result)from the disk (the drive) , stores the result in the cache, and when the user initiates the same request the second time, The process will match the cached results in the buffer and return the data directly. Memory read and write efficiency is more than 10 times times the disk. Therefore, this technology increases the efficiency of process processing data and reduces the use of disk IO.
What is buffer, buffer?
Buffer (buffered) is an optimization technique in memory when "write" Data .
Buffer is to occupy an area in memory to do the process of data buffering, such as uploading a data (file), the data is processed by the process, the process calls the memory persistence of the data written to disk, the data in memory will be divided into an uneven size of information data block Persistent write disks, which are written to disk in a slow and inefficient manner, and because of uneven size can result in disk fragmentation. Buffer is a technique for data-block traffic shaping of these uneven sizes, which are first stored in buffers, waiting for the accumulated number of blocks to fill the entire buffer size, and then written from the buffer to disk. So , in general, a buffer size is equal to the paging size of the system.
The paging size of the system is the storage block size of the disk's file system. If it is a Windows system, we can usually see it in the format, that is, "allocation unit size". If it is Linux, it can be viewed with the " getconf page_size" command.
Cache and buffer (buffered)