In
computer science,
random access (more precisely and more generally called
direct access) is the ability to access an item of data at any given coordinates in a population of
addressable elements. As a rule the assumption is that each element can be accessed roughly as easily and efficiently as any other, no matter how many elements may be in the set, nor how many coordinates may be available for addressing the data. For example, data might be stored notionally in a single sequence like a row, in two dimensions like rows and columns on a surface, or in multiple dimensions. However, given all the coordinates, a program can access each record about as quickly and easily as any other, and in particular, access it in time to be of value to the user. In this sense the choice of data item is arbitrary in the sense that no matter which item is sought, all that is needed to find it, is its address, that is to say, the coordinates at which it is located, such as its row and column (or its track and record number on a magnetic drum). At first the term "random access" was used because the process had to be capable of finding records no matter in which sequence they were required. However, soon the term "direct access" gained favour because one could directly retrieve a record, no matter what its position might be. The operative attribute however is that the device can access any required record immediately on demand. The opposite is
sequential access, where a remote element takes longer time to access.
[1] A typical illustration of this distinction is to compare an ancient
scroll (sequential; all material prior to the data needed must be unrolled) and the
book (direct: can be immediately flipped open to any arbitrary
page). A more modern example is a cassette tape (sequential — one must fast forward through earlier songs to get to later ones) and a
CD (direct access — one can skip to the track wanted, knowing that it would be the one retrieved).