Data Block
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
(specifically
data transmission Data communication, including data transmission and data reception, is the transfer of data, signal transmission, transmitted and received over a Point-to-point (telecommunications), point-to-point or point-to-multipoint communication chann ...
and
data storage Data storage is the recording (storing) of information (data) in a storage medium. Handwriting, phonographic recording, magnetic tape, and optical discs are all examples of storage media. Biological molecules such as RNA and DNA are con ...
), a block, sometimes called a physical record, is a sequence of
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
s or
bit The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
s, usually containing some whole number of records, having a fixed length; a ''block size''. Data thus
structured Structuring, also known as smurfing in banking jargon, is the practice of executing financial transactions such as making bank deposits in a specific pattern, calculated to avoid triggering financial institutions to file reports required by law ...
are said to be ''blocked''. The process of putting data into blocks is called ''blocking'', while ''deblocking'' is the process of extracting data from blocks. Blocked data is normally stored in a
data buffer In computer science, a data buffer (or just buffer) is a region of memory used to store data temporarily while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as ...
, and read or written a whole block at a time. Blocking reduces the overhead and speeds up the handling of the
data stream In connection-oriented communication, a data stream is the transmission of a sequence of digitally encoded signals to convey information. Typically, the transmitted symbols are grouped into a series of packets. Data streaming has become u ...
. For some devices, such as magnetic tape and CKD disk devices, blocking reduces the amount of external storage required for the data. Blocking is almost universally employed when storing data to 9-track
magnetic tape Magnetic tape is a medium for magnetic storage made of a thin, magnetizable coating on a long, narrow strip of plastic film. It was developed in Germany in 1928, based on the earlier magnetic wire recording from Denmark. Devices that use magnetic ...
, NAND
flash memory Flash memory is an Integrated circuit, electronic Non-volatile memory, non-volatile computer memory storage medium that can be electrically erased and reprogrammed. The two main types of flash memory, NOR flash and NAND flash, are named for t ...
, and rotating media such as
floppy disk A floppy disk or floppy diskette (casually referred to as a floppy, a diskette, or a disk) is a type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined with a ...
s,
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating hard disk drive platter, pla ...
s, and
optical disc An optical disc is a flat, usuallyNon-circular optical discs exist for fashion purposes; see shaped compact disc. disc-shaped object that stores information in the form of physical variations on its surface that can be read with the aid o ...
s. Most file systems are based on a
block device In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These spec ...
, which is a level of
abstraction Abstraction is a process where general rules and concepts are derived from the use and classifying of specific examples, literal (reality, real or Abstract and concrete, concrete) signifiers, first principles, or other methods. "An abstraction" ...
for the hardware responsible for storing and retrieving specified blocks of data, though the block size in file systems may be a multiple of the physical block size. This leads to space inefficiency due to
internal fragmentation In computer storage, fragmentation is a phenomenon in the computer system which involves the distribution of data in to smaller pieces which storage space, such as computer memory or a hard drive, is used inefficiently, reducing capacity or perfo ...
, since file lengths are often not integer multiples of block size, and thus the last block of a file may remain partially empty. This will create
slack space In computer storage, fragmentation is a phenomenon in the computer system which involves the distribution of data in to smaller pieces which storage space, such as computer memory or a hard drive, is used inefficiently, reducing capacity or perfo ...
. Some newer file systems, such as
Btrfs Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or "B.T.R.F.S.") is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (distinct from Linux's LVM), d ...
and
FreeBSD FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
UFS2, attempt to solve this through techniques called block suballocation and tail merging. Other file systems such as
ZFS ZFS (previously Zettabyte File System) is a file system with Volume manager, volume management capabilities. It began as part of the Sun Microsystems Solaris (operating system), Solaris operating system in 2001. Large parts of Solaris, includin ...
support variable block sizes. Block storage is normally abstracted by a file system or
database management system In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and an ...
(DBMS) for use by applications and end users. The physical or logical volumes accessed via ''block I/O'' may be devices internal to a server, directly attached via
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices, best known for its use with storage devices such as hard disk drives. SCSI was introduced ...
or
Fibre Channel Fibre Channel (FC) is a high-speed data transfer protocol providing in-order, lossless delivery of raw block data. Fibre Channel is primarily used to connect computer data storage to Server (computing), servers in storage area networks (SAN) in ...
, or distant devices accessed via a
storage area network A storage area network (SAN) or storage network is a computer network which provides access to consolidated, block device, block-level data storage. SANs are primarily used to access Computer data storage, data storage devices, such as disk ...
(SAN) using a protocol such as
iSCSI Internet Small Computer Systems Interface or iSCSI ( ) is an Internet Protocol-based storage networking standard for linking data storage facilities. iSCSI provides block-level access to storage devices by carrying SCSI commands over a TCP/IP ...
, or AoE. DBMSes often use their own block I/O for improved performance and recoverability as compared to layering the DBMS on top of a file system. On Linux the default block size for most file systems is 4096 bytes. The command part of
GNU Core Utilities The GNU Core Utilities or coreutils is a collection of GNU software that implements many standard, Unix-based shell commands. The utilities generally provide POSIX compliant interface when the environment variable is set, but otherwise offers ...
can be used to check the block size. In
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH) ...
a block can be read with the method. const BLOCK_SIZE: usize = 4096; if let Ok(mut file) = File::open("example.bin") In
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
a block can be read with the method. BLOCK_SIZE = 4096 with open("example.bin", "rb") as file: block = file.read(BLOCK_SIZE) In C# a block can be read with the class. const int BLOCK_SIZE = 4096; using FileStream stream = File.Open("example.bin", FileMode.Open); var block = new byte LOCK_SIZE await stream.ReadAsync(block, 0, BLOCK_SIZE);


References

{{reflist, refs= {{cite news , author= , title=Available hard drive space, block sizes, and size terminology , newspaper=CNET , date=2009-05-05 , url=http://www.cnet.com/news/available-hard-drive-space-block-sizes-and-size-terminology/ , access-date=2014-04-29 {{cite web , author-last=Chang , author-first=S. K. , title=Physical Structures , work=Captain SK , url=http://people.cs.pitt.edu/~chang/156/08struct.html , access-date=2014-04-29 {{cite news , author-first=Rachel , author-last=Balik , title=Bruning Questions: ZFS Record Size , newspaper=Joyent , date=2013-03-29 , url=https://www.joyent.com/blog/bruning-questions-zfs-record-size/ , access-date=2013-03-29 {{cite news , author-first=Roch , author-last=Bourbonnais , title=Tuning ZFS recordsize , date=2006-06-07 , newspaper=Oracle , url=https://blogs.oracle.com/roch/tuning-zfs-recordsize {{citation , title=Planning a Computer System – Project Stretch , author-first1=Gerrit Anne , author-last1=Blaauw , author-link1=Gerrit Anne Blaauw , author-first2=Frederick Phillips , author-last2=Brooks, Jr. , author-link2=Frederick Phillips Brooks, Jr. , author-first3=Werner , author-last3=Buchholz , author-link3=Werner Buchholz , editor-first=Werner , editor-last=Buchholz , editor-link=Werner Buchholz , publisher= McGraw-Hill Book Company, Inc. / The Maple Press Company, York, PA. , lccn=61-10466 , date=1962 , chapter=4: Natural Data Units , pages=39–40 , chapter-url=http://archive.computerhistory.org/resources/text/IBM/Stretch/pdfs/Buchholz_102636426.pdf , access-date=2017-04-03 , url-status=live , archive-url=https://web.archive.org/web/20170403014651/http://archive.computerhistory.org/resources/text/IBM/Stretch/pdfs/Buchholz_102636426.pdf , archive-date=2017-04-03 , quote= ��Terms used here to describe the structure imposed by the machine design, in addition to ''
bit The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
'', are listed below.
''
Byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
'' denotes a group of bits used to encode a character, or the number of bits transmitted in parallel to and from input-output units. A term other than '' character'' is used here because a given character may be represented in different applications by more than one code, and different codes may use different numbers of bits (i.e., different byte sizes). In input-output transmission the grouping of bits may be completely arbitrary and have no relation to actual characters. (The term is coined from ''
bite Biting is an action involving a set of teeth closing down on an object. It is a common zoological behavior, being found in toothed animals such as mammals, reptiles, amphibians, fishes, and arthropods. Biting is also an action humans participate ...
'', but respelled to avoid accidental mutation to ''bit''.)
A ''
word A word is a basic element of language that carries semantics, meaning, can be used on its own, and is uninterruptible. Despite the fact that language speakers often have an intuitive grasp of what a word is, there is no consensus among linguist ...
'' consists of the number of data bits transmitted in parallel from or to memory in one memory cycle.
Word size In computing, a word is any processor design's natural unit of data. A word is a fixed-sized datum handled as a unit by the instruction set or the hardware of the processor. The number of bits or digits in a word (the ''word size'', ''word wid ...
is thus defined as a structural property of the memory. (The term '' catena'' was coined for this purpose by the designers of the
Bull A bull is an intact (i.e., not Castration, castrated) adult male of the species ''Bos taurus'' (cattle). More muscular and aggressive than the females of the same species (i.e. cows proper), bulls have long been an important symbol cattle in r ...
{{ill, Bull Gamma 60{{!GAMMA 60, fr, Gamma 60 computer.)
''Block'' refers to the number of words transmitted to or from an input-output unit in response to a single input-output instruction. Block size is a structural property of an input-output unit; it may have been fixed by the design or left to be varied by the program. ��}
Articles with example C Sharp code Articles with example Python (programming language) code Articles with example Rust code Computer data storage Data transmission