IO - Block (Batch on device)

1 - About

A block is a unit of storage representing a fix number of bytes called the block size.

It implements the concept of batch where data is organised 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.

3 - Property

3.1 - Location

On memory, the location of the block is the offset.

Generally, when referring to a batch of data bytes, the following words are used to differentiate the location of the data:

3.2 - Size

Example of block sizes:

  • 250 (bittorrent),
  • 512 (the most used)
  • 1024 bytes
  • 2048-byte blocks. (ISO 9660 CDs and images of them)

3.3 - 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 IO - Fragmentation

4 - Blocked application

4.1 - 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.

4.2 - 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.

4.3 - Virtual memory

For the virtual memory application, a logical block is called a memory page

4.4 - 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.

5 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap