File Structure
File Structure
● Storage media refers to any device that allows data to be stored permanently
● Mechanical or electronic devices
○ Store data= Write data= save a file
○ Recover data = read data= open a file
● Each device is limited by the maximum amount of data that can be stored on it.
https://docs.oracle.com/cd/E19253-01/819-6957/chp-typeopexpr-2/index.html
medios de almacenamiento se refiere a cualquier dispositivo que permite que los datos
se almacenen de forma permanente
● Dispositivos mecánicos o electrónicos
○ Almacenar datos = Escribir datos = guardar un archivo
○ Recuperar datos = leer datos = abrir un archivo
● Cada dispositivo está limitado por la cantidad máxima de datos que se pueden
almacenar en él.
About memory
● File organization ensures that records are available for processing. There are three
types of organizing the file:
1. Sequential access file organization
2. Direct access file organization
3. Indexed sequential access file organization
La organización de archivos garantiza que los registros estén disponibles para su procesamiento.
Hay tres tipos de organización del archivo:
1. Organización de archivos de acceso secuencial
2. Organización de archivos de acceso directo
3. Organización de archivos de acceso secuencial indexado
Sequential file organization
• Store and sort in contiguous block within files.
• In sequential access file organization, all records are stored in a
sequential order. The records are arranged in the ascending or
descending order of a key field.
• Sequential file search starts from the beginning of the file and the records
can be added at the end of the file.
• In sequential file, it is not possible to add a record in the middle of the file
without rewriting the file.
Almacenar y ordenar en un bloque contiguo dentro de los archivos.
• En la organización de archivos de acceso secuencial, todos los registros se almacenan en un orden secuencial. Los
registros están organizados en el orden ascendente o descendente de un campo clave.
• La búsqueda secuencial de archivos comienza desde el principio del archivo y los registros se pueden agregar al final
del archivo. • En el archivo secuencial, no es posible añadir un registro en el medio del archivo sin reescribir el archivo.
Sequential file organization
Advantages Disadvantages
• It is simple to program and easy • Sequential file is time consuming
to design. process.
• Sequential file is best use if • It has high data redundancy.
storage space.
• Random searching is not possible.
• This approach is used when a
large number of records must be • After you place a record into a
accessed, such as when sequential file, you cannot shorten,
calculating a student’s grade or lengthen, or delete the record.
generating a wage slip. However, you can update (REWRITE) a
record if the length does not change.
• This strategy is employed in the
creation of reports and statistical
calculations.
Direct Access file organization
Advantages Disadvantages
• Direct access file helps in online • Direct access file does not provide back
transaction processing system up facility.
(OLTP) like online railway
reservation system. • Implementation of direct-access
systems is often difficult because of the
• In direct access file, sorting of the complexity and the high level of
records are not required. programming (software) support that
such systems need. In addition, the
• It accesses the desired records cost of developing and maintaining a
immediately. direct-access system is greater than
• It updates several files quickly. the expense of a sequential processing
system.
• It has better control over record
allocation. • It has less storage space as compared
to sequential file.
Indexed sequential access file
organization
• Indexed sequential access file combines both sequential file and
direct access file organization.
• In indexed sequential access file, records are stored randomly on a
direct access device such as magnetic disk by a primary key.
• The data can be access either sequentially or randomly using the
index. The index is stored in a file and read into memory when the
file is opened.
Indexed sequential access file
organization
Advantages Disadvantages
• In indexed sequential access file, • Indexed sequential access file requires
sequential file and random file unique keys and periodic
access is possible. reorganization.
• It accesses the records very fast if • Indexed sequential access file takes
the index table is properly longer time to search the index for the
organized. data access or retrieval.
• The records can be inserted in the • It requires more storage space.
middle of the file.
• It is expensive because it requires
• It provides quick access for special software.
sequential and direct processing.
• It is less efficient in the use of storage
• It reduces the degree of the space as compared to other file
sequential search. organizations.
Indexed sequential access file organization
Imagen tomada de
https://www.researchgate.net/publication/273380260_ADMINISTRACION_DE_ARCHIVOS_Ejemplos_practicos_de_utilizacion_de_archivos_Secuenciales_Indexados_y_directos_utilizando_el_lenguaje_C/figures?
lo=1&utm_source=google&utm_medium=organic
Referencias
● https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/
● https://www.tutorialride.com/data-structures/file-organization-in-data-structure.htm
● https://www.ibm.com/docs/en/cobol-aix/5.1?topic=mode-file-organization-access
● https://byjus.com/gate/sequential-file-organization-in-dbms-notes/