Open In App

Sparse Files

Sparse Files are a type of computer file that allows for efficient storage allocation for large data. A file is considered to be sparse when much of its data is zero (empty data). Support for the creation of such files is generally provided by the File system. This type of file is used significantly in computer science areas such as DBMS (Database Management Systems), Digital Image Processing, etc. 

Working : Sparse files are created differently than a normal (non-empty) file. Whenever a sparse file is created metadata representing the empty blocks (bytes) of disks is written to the disk, rather than the actual bytes which make up block, using less disk space. This is because empty bytes don’t need to be saved, thus they can be represented by metadata. Actual data blocks are only written when any non-empty (zero) data is written to the file. When reading sparse files, the file system transparently converts metadata representing empty blocks into “real” blocks filled with null bytes at runtime. The application is unaware of this conversion as conversion happens at the file system level. A sparse file need not be totally filled with null data, rather certain empty sections of a file could also be flagged as sparse. The data still follows the aforementioned mechanism, but on a smaller scale. 



Advantages of Sparse files :

Disadvantages of Sparse files :



Article Tags :