Indexed Sequential Access Method (ISAM) is a method for creating, maintaining, and manipulating computer files of data so that records can be retrieved sequentially or randomly by one or more keys. Indexes of key fields are maintained to achieve fast retrieval of required file records in indexed files. IBM originally developed ISAM for mainframe computers, but implementations are available for most computer systems.
The term ISAM is used for several related concepts:
- The IBM ISAM product and the algorithm it employs.
- A database system where an application developer directly uses an application programming interface to search indexes in order to locate records in data files. In contrast, a relational database uses a query optimizer which automatically selects indexes.
- An indexing algorithm that allows both sequential and keyed access to data. Most databases use some variation of the B-tree for this purpose, although the original IBM ISAM and VSAM implementations did not do so.
- Most generally, any index for a database. Indexes are used by almost all databases.
Organization
In an ISAM system, data is organized into records which are composed of fixed length fields, originally stored sequentially in key sequence. Secondary set(s) of records, known as indexes, contain pointers to the location of each record, allowing individual records to be retrieved without having to search the entire data set. This differs from the contemporaneous navigational databases, in which the pointers to other records were stored inside the records themselves. The key improvement in ISAM is that the indexes are small and can be searched quickly, possibly entirely in memory, thereby allowing the database to access only the records it needs. Additional modifications to the data do not require changes to other data, only the table and indexes in question.
When an ISAM file is created, index nodes are fixed, and their pointers do not change during inserts and deletes that occur later (only content of leaf nodes change afterwards). As a consequence of this, if inserts to some leaf node exceed the node's capacity, new records are stored in overflow chains. If there are many more inserts than deletions from a table, these overflow chains can gradually become very large, and this affects the time required for retrieval of a record.
Relational databases can easily be built on an ISAM framework with the addition of logic to maintain the validity of the links between the tables. Typically the field being used as the link, the foreign key, will be indexed for quick lookup. While this is slower than simply storing the pointer to the related data directly in the records, it also means that changes to the physical layout of the data do not require any updating of the pointers—the entry will still be valid.
ISAM is simple to understand and implement, as it primarily consists of direct access to a database file. The trade-off is that each client machine must manage its own connection to each file it accesses. This, in turn, leads to the possibility of conflicting inserts into those files, leading to an inconsistent database state. To prevent this, some ISAM implementations provide whole-file or individual record locking functionality. Locking multiple records runs the risk of deadlock unless a deadlock prevention scheme is strictly followed. The problems of locking, and deadlock are typically solved with the addition of a client–server framework which marshals client requests and maintains ordering. Full ACID transaction management systems are provided by some ISAM client–server implementations. This increased the busy time of the channel, control unit, and disk. With increased physical and virtual memory sizes in later systems this was seen as inefficient, and VSAM was developed to alter the tradeoff between memory usage and disk activity.
ISAM's use of self-modifying channel programs later caused difficulties for CP-67 support of OS/360, since CP-67 copied an entire channel program into fixed memory when the I/O operation was started and translated virtual addresses to real addresses.
ISAM-style implementations
- Advantage Database Server database manager
- Berkeley DB
- Btrieve
- FairCom DB
- C-ISAM
- DataFlex proprietary database
- dBase and related products Clipper and FoxPro
- Digital Equipment Corporation Record Management Services
- Enscribe is the HP Tandem structured file access method
- Extensible Storage Engine
- Access Database Engine (ACE and formerly JET) used by Microsoft Access
- MySQL implements and extends ISAM as MyISAM
- Paradox
- pblIsam GPL implementation written in C
- Superbase database family
- dbm DBM and flat-file databases working in tandem
See also
- Sequential access memory (SAM)
- Virtual storage access method (VSAM)
- Flat-file database
- NoSQL
- dbm
