CSC 283 · Information Systems and File Structures
The main ways to organise a file, the operations performed on files, and how to choose the right organisation.
Our notes
2 min readFile organisation and access method
- File organisation is how records are arranged on the storage device.
- Access method is how a program gets to a record: sequentially (one after another) or directly (straight to the one wanted).
The organisation limits which access methods are efficient.
The four classic organisations
| Organisation | Arrangement | Access | Device |
|---|---|---|---|
| Serial | in the order they arrive, no key order | sequential only | tape or disk |
| Sequential | in order of the primary key | sequential (binary search possible on disk) | tape or disk |
| Indexed sequential | in key order, plus an index | sequential and direct | disk |
| Direct (random, relative, hashed) | position worked out from the key | direct | disk |
Operations on files
- Create: set up a new file and write its first records.
- Open / close: connect the program to the file and release it.
- Read / retrieve: fetch a record (next one or by key).
- Write / insert: add a record.
- Update / amend: change fields of an existing record.
- Delete: remove a record, often first by marking it deleted (a tombstone) and removing it later.
- Sort and merge: reorder records or combine two ordered files.
- Search / query: find records that meet a condition.
Hit rate (activity ratio)
Hit rate = records accessed in a run ÷ records in the file × 100%.
- High hit rate (payroll: every employee is paid): sequential processing is efficient.
- Low hit rate (an enquiry about one student): direct access is needed.
Example: 300 transactions touch a 20,000-record master file: hit rate = 300 ÷ 20,000 = 1.5%. Reading the whole file sequentially to update 1.5% of it wastes most of the run, so direct or indexed access is better.
Volatility and growth
- Volatility: how often records are added and deleted. A very volatile file is awkward in sequential form (every insert means rewriting) and suits direct or indexed organisation with free space.
- Growth: files that grow fast need room for expansion (overflow areas, spare buckets).
Choosing an organisation
Ask:
- Hit rate per run.
- Response time needed (batch overnight or seconds at a counter).
- Volatility and growth.
- Device available (tape allows only serial and sequential).
- Size of the file and cost of storage.
Exams usually ask
- Name and compare the four file organisations.
- Define hit rate and volatility and explain how they affect the choice.
- List file operations.
Common mistake
Calling a serial file sequential. Both are read one record after another, but only a sequential file is in key order; a serial file is in arrival order.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
No reading links here yet
Our team adds free books, videos and practice for each topic, and opens every link before it goes up.