Chapter 1
Chapter 1
CHAPTER 5
CONCEPT OF RECORD, FIELD, CHARACTER, BYTE AND BIT IN
RELATION TO A FILE
RECORDS
Several related fields can be used to compose a record. In a payroll
system, for example,
The record for an employee might consist of the following fields
(possible types for these fields are shown in parentheses):
• Employee identification number (a whole number).
• Name (a string of characters).
• Address (a string of characters).
• Hourly pay rate (a number with a decimal point).
• Year-to-date earnings (a number with a decimal point).
• Amount of taxes withheld (a number with a decimal point).
Thus, a record is a group of related fields. All the fields listed above
belong to the same employee. A company might have many employees
and a payroll record for each.
FIELDS
Just as characters are composed of bits, fields are composed of
characters or bytes. A field is a group of characters or bytes that
conveys meaning. For example, a field consisting of uppercase and
lowercase letters can be used to represent a person’s name, and a field
consisting of decimal digits could represent a person’s age.
CHARACTERS
Work with data in the low-level form of bits is tedious. Instead, people
prefer to work with decimal digits (0–9), letters (A–Z and a–z) and
special symbols such as $ @ % & * ( ) – + ” : ; , ? / Digits, letters and
special symbols are known as characters. The computer’s character set
contains the characters used to write programs and represent data
items. Computers process only 1s and 0s, so a computer’s character set
represents every character as a pattern of 1s and 0s. Python uses
Unicode® characters that are composed of one, two, three or four
bytes (8, 16, 24 or 32 bits, respectively)—known as UTF-8 encoding.5
Unicode contains characters for many of the world’s languages. The
ASCII (American Standard Code for Information Interchange) character
set is a subset of Unicode that represents letters (a–z and A–Z), digits
and some common special characters.
BITS
A bit (short for “binary digit”—a digit that can assume one of two
values) is the smallest data item in a computer. It can have the value 0
or 1. Remarkably, the impressive functions performed by computers
involve only the simplest manipulations of 0s and 1s—examining a bit’s
value, setting a bit’s value and reversing a bit’s value (from 1 to 0 or
from 0 to 1). Bits for the basis of the binary number system, which you
can study in-depth in our online “Number Systems” appendix.
CHAPTER 6
SEEK, READ, WRITE, FETCH, INSERT, DELETE AND UPDATE
OPERATION
WRITE OR CREATE
The CREATE operation adds a new record to a database. In RDBMS, a
database table row is referred to as a record, while columns are called
attributes or fields. The CREATE operation adds one or more new
records with distinct field values in a table.
The same principle applies to NoSQL databases. If the NoSQL database
is document-oriented, then a new document (for example, a JSON
formatted document with its attributes) is added to the collection,
which is the equivalent of an RDBMS table. Similarly, in NoSQL
databases like DynamoDB, the CREATE operation adds an item (which is
equivalent to a record) to a table.
READ
READ returns records (or documents or items) from a database table
(or collection or bucket) based on some search criteria. The READ
operation can return all records and some or all fields.
UPDATE
UPDATE is used to modify existing records in the database. For
example, this can be the change of address in a customer database or
price change in a product database. Similar to READ, UPDATEs can be
applied across all records or only a few, based on criteria. An UPDATE
operation can modify and persist changes to a single field or to multiple
fields of the record. If multiple fields are to be updated, the database
system ensures they are all updated or not at all. Some big data
systems don’t implement UPDATE but allow only a timestamped
CREATE operation, adding a new version of the row each time.
DELETE
DELETE operations allow the user to remove records from the
database. A hard delete removes the record altogether, while a soft
delete flags the record but leaves it in place. For example, this is
important in payroll where employment records need to be maintained
even after an employee has left the company.
FETCH
FETCH retrieves rows of data from the result set of a multiple-row
query—one row at a time, several rows at a time, or all rows at once
and stores the data in variables, records, or collections.
INSERT
The Insert operation is called Enqueue, and adds an element to the end
of the list; the Dequeue operation selects and removes its first element.
As a result, the neighbors of the source node are generated layer by
layer (one edge apart, two edges apart, and so on).
SEEK
The Seek operation allows the application program to change the value
of the file pointer so that subsequent Read/Write is performed from a
new position in the file. The new value of the file pointer is determined
by adding the offset to the current value.
CHAPTER 7
QUATITATIVELY FILE SYSTEM PERFORMANCE IN TERMS OF
FETCH INSERT, UPDATE AND ORGANIZATION
In computing, a file system (often also written as filesystem) is a
method for storing and organizing computer files and the data they
contain to make it easy to find and access them. File systems may use a
data storage device such as a hard disk or CD-ROM and involve
maintaining the physical location of the files, they might provide access
to data on a file server by acting as clients for a network protocol (e.g.,
NFS, SMB, or 9P clients), or they may be virtual and exist only as an
access method for virtual data (e.g., procfs). More formally, a file
system is a special-purpose database for the storage, hierarchical
organization, manipulation, navigation, access, and retrieval of data.