Computers14 Ch6


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Computers14 Ch6

  1. 1. Storage and Multimedia Chapter 6 B.M.H
  2. 2. Index <ul><li>How data is organized </li></ul><ul><li>How to access the file </li></ul><ul><ul><li>File organization </li></ul></ul><ul><ul><ul><li>Sequential file organization </li></ul></ul></ul><ul><ul><ul><li>Direct file organization </li></ul></ul></ul><ul><ul><ul><li>Indexed file organization </li></ul></ul></ul><ul><li>How to process the file </li></ul><ul><ul><li>Batch processing </li></ul></ul><ul><ul><li>Transaction processing </li></ul></ul>
  3. 3. How data is organized <ul><li>Raw data is organized into </li></ul><ul><ul><li>Characters </li></ul></ul><ul><ul><li>Fields </li></ul></ul><ul><ul><li>Records </li></ul></ul><ul><ul><li>File </li></ul></ul><ul><ul><li>Databases </li></ul></ul>
  4. 4. How data is organized <ul><li>Characters </li></ul><ul><ul><li>the smallest element </li></ul></ul><ul><ul><li>A letter, digit, or special character </li></ul></ul><ul><li>Fields </li></ul><ul><ul><li>A set of related characters </li></ul></ul><ul><li>Records </li></ul><ul><ul><li>A collection of related fields </li></ul></ul>
  5. 5. How data is organized <ul><li>File </li></ul><ul><ul><li>A collection of related records </li></ul></ul><ul><li>Databases </li></ul><ul><ul><li>A collection of interrelated files stored together with minimum redundancy </li></ul></ul>
  6. 6. How data is organized <ul><li>Key </li></ul><ul><ul><li>A field of particular interest </li></ul></ul><ul><ul><li>A unique identifier for a record </li></ul></ul><ul><ul><li>Ex. custom number, product number, social security number, </li></ul></ul>
  7. 7. The File Plan <ul><li>The plan considered by some computer professional </li></ul><ul><ul><li>How to access the file </li></ul></ul><ul><ul><ul><li>File organization </li></ul></ul></ul><ul><ul><li>How to process the file </li></ul></ul>
  8. 8. How to access the file
  9. 9. File organization <ul><li>Three major methods of organizing data files in secondary storage </li></ul><ul><ul><li>Sequential file organization </li></ul></ul><ul><ul><li>Direct file organization </li></ul></ul><ul><ul><li>Indexed file organization </li></ul></ul>
  10. 10. Sequential File Organization <ul><li>Records are arranged sequentially </li></ul><ul><ul><li>stored in order according to a key field </li></ul></ul><ul><li>To find a particular record </li></ul><ul><ul><li>All the prior records in the file must be read before the desired record is reached </li></ul></ul>
  11. 11. Direct File Organization <ul><li>Random file organization </li></ul><ul><li>Allows direct (random) access </li></ul><ul><ul><li>The ability to go directly to the desired record by using a record key </li></ul></ul><ul><li>The benefit </li></ul><ul><ul><li>the ability to read, change, and return a record to its same place on the disk </li></ul></ul><ul><ul><li>called updating in place </li></ul></ul>
  12. 12. Direct File Organization <ul><li>To find the record on a disk </li></ul><ul><ul><li>Used a certain formula to apply to the record key </li></ul></ul><ul><ul><ul><li>Deriving a number to use as the disk address </li></ul></ul></ul><ul><ul><li>Hashing, or randomizing algorithm </li></ul></ul><ul><ul><ul><li>The mathematical operation that is applied to a key to yield a number that represents the address </li></ul></ul></ul>
  13. 13. Simple Hashing Schemes <ul><li>A general idea of how the process works </li></ul>
  14. 15. Hashing Algorithm <ul><li>Collision </li></ul><ul><ul><li>For a hashing algorithm to produce the same disk address (called synonym) for two different records </li></ul></ul><ul><ul><ul><li>Even though the record keys are unique </li></ul></ul></ul><ul><li>To recover from a collision </li></ul><ul><ul><li>One way : to use the next available record slot in the disk  fig 6-13 </li></ul></ul>
  15. 16. Indexed File Organization <ul><li>A compromise between the sequential and direct methods </li></ul><ul><ul><li>Records are stored in sequential order </li></ul></ul><ul><ul><li>The file also contains an index </li></ul></ul><ul><ul><ul><li>The index contain </li></ul></ul></ul><ul><ul><ul><ul><li>The record key </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The address associated with the key </li></ul></ul></ul></ul>
  16. 17. Storage media <ul><li>Tape storage </li></ul><ul><ul><li>Limited to sequential file organization </li></ul></ul><ul><li>Disk storage </li></ul><ul><ul><li>May be sequential , and also accessed directly </li></ul></ul><ul><ul><li>a direct-access storage device (DASD) </li></ul></ul><ul><ul><ul><li>The computer can go directly to the desired record on the disk </li></ul></ul></ul>
  17. 18. How to process the file
  18. 19. Processing stored data <ul><li>Most business file processing </li></ul><ul><ul><li>involves processing transactions to update a master file </li></ul></ul><ul><ul><li>Transaction : a business event that required the business’s records to be updated </li></ul></ul><ul><ul><ul><li>Ex. a retail sale, the receipt of ordered goods </li></ul></ul></ul><ul><ul><li>Master file : contains data that must be updated as transactions occur </li></ul></ul><ul><ul><ul><li>Ex. an inventory file, an employee file, a customer file </li></ul></ul></ul>
  19. 20. Processing stored data <ul><li>Two main methods </li></ul><ul><ul><li>Batch processing </li></ul></ul><ul><ul><li>Transaction processing </li></ul></ul>
  20. 21. Batch processing <ul><li>A technique of processing transaction data in groups at a more convenient later time </li></ul><ul><ul><li>Transactions are collected into batches </li></ul></ul><ul><ul><li>to be processed at a time </li></ul></ul><ul><ul><ul><li>when the computer may have few online users and thus be more accessible, often during the night </li></ul></ul></ul><ul><li>No direct user interaction </li></ul><ul><li>Ex. web page club’s member file </li></ul>
  21. 22. Batch processing <ul><li>Transaction file </li></ul><ul><ul><li>Contains all changes to be made to the master file: additions, deletions, and revisions </li></ul></ul><ul><li>Master file </li></ul><ul><ul><li>Periodically updated with the changes called for in the transaction file </li></ul></ul>
  22. 23. Batch processing <ul><li>Changes are stored in transaction files </li></ul><ul><li>Transaction file is sorted by a key field </li></ul><ul><ul><li>All the transactions are in sequential order </li></ul></ul><ul><ul><li>Ex. By the member number of the webpage club </li></ul></ul><ul><li>Matching the keys from the mater file and transaction files </li></ul><ul><ul><li>Records of mater file already are in order </li></ul></ul><ul><li>CPU processes the appropriate action </li></ul><ul><li>A newly updated master file is created </li></ul>
  23. 25. Batch processing <ul><li>Advantage </li></ul><ul><ul><li>Efficiency </li></ul></ul><ul><li>Disadvantage </li></ul><ul><ul><li>The master file is current only immediately after processing </li></ul></ul>
  24. 26. Transaction processing <ul><li>A technique of processing transactions immediately, as they occur </li></ul><ul><ul><li>Each transaction is handled immediately </li></ul></ul><ul><ul><li>Real-time processing </li></ul></ul><ul><ul><ul><li>A transaction is processed fast enough for the result to come back and be acted upon right away </li></ul></ul></ul><ul><ul><li>Online : </li></ul></ul><ul><ul><ul><li>the terminals must be connected directly to the computer </li></ul></ul></ul><ul><li>Ex. bank withdrawal, flight reservation </li></ul>
  25. 27. Transaction processing <ul><li>Use disk storage </li></ul><ul><ul><li>For direct access to the desired record </li></ul></ul><ul><li>Advantage </li></ul><ul><ul><li>Immediate access to stored data </li></ul></ul><ul><ul><li>Immediate updating of the stored data </li></ul></ul>
  26. 29. Batch & Transaction Processing <ul><li>Numerous computer system </li></ul><ul><ul><li>combine the best features of both methods of processing </li></ul></ul><ul><ul><ul><li>Transaction processing : used for activities related to the current needs of people </li></ul></ul></ul><ul><ul><ul><li>Batch processing : done at any time, even in the middle of the night </li></ul></ul></ul>
  27. 30. Batch & Transaction Processing <ul><li>Ex. Store system </li></ul><ul><ul><li>Updating the individual item’s inventory </li></ul></ul><ul><ul><ul><li>Needed transaction processing </li></ul></ul></ul><ul><ul><li>Producing daily and weekly sales report </li></ul></ul><ul><ul><ul><li>Used batch processing </li></ul></ul></ul>