About
A block is a unit of storage representing a fix number of bytes called the block size.
It's also known as the minimum unit of transfer.
It implements the concept of batch where data is organized into logical “blocks” for transmission between devices.
The block defines the smallest data unit processed. Within any application (file system included), you get blocks not bytes. If you want to read a particular byte, you need to ask a block and to read this block to get your byte.
Data thus structured are said to be blocked.
The process of putting data into blocks is called blocking. Blocking is used to facilitate the handling of the data-stream by the computer program receiving the data.
Blocked data are read a whole block at a time.
Breaking the file into pieces (block) allows it to be distributed as efficiently as possible using less bandwidth.
Articles Related
Property
Location
On memory, the location of the block is the offset.
Size
Example of block sizes:
- 250 (bittorrent),
- 512 (the most used)
- 1024 bytes
- 2048-byte blocks. (ISO 9660 CDs and images of them)
Fragmentation
A single block may be not full or contains only a part of the data unit (A file for a file system, a table for a database, …) which creates space inefficiency. See File System - Fragmentation
Blocked application
File System
On a file system level, the block abstraction is called a cluster which is a multiple of the device block size. It is the minimal unit of a IO request
The physical or logical volumes accessed via block I/O may be:
- devices internal to a server, direct attached via SCSI or Fibre Channel,
- or distant devices accessed via a storage area network (SAN) using a protocol such as iSCSI, or AoE.
Hardware Device
The block abstraction on a hardware device is the sector. A block has usually the size of a sector.
A disk is a block device. Blocking is almost universally employed when storing data to media.
The UNIX/Linux communities employ the term block to refer to a sector or group of sectors.
For example, the Linux fdisk utility normally displays partition table information using 512-byte blocks while also using sector to help describe a disk's size with its phrase, 63 sectors/track.
Virtual memory
For the virtual memory application, a logical block is called a memory page
Database
database management system such as Oracle Database or essbase use their own block I/O for improved performance and recoverability as compared to layering the DBMS on top of a file system.