Part 1
I would choose to implement a database rather than a file system because a database has more capabilities than a file system. For one, a database allows a search to be performed based on the file’s metadata. On the other hand, the user must know the path of a file’s location when searching for a file in a file system. A database allows for the data to be filtered and sorted in a number of ways, which is not possible with a file system. In addition, a database system comes with data backup and redundancy features. Creating backups and checking for redundancy need to be performed manually in file systems.
Although it’s possible for the actual files to be stored in a file system with only the URLs stored in the database for faster access, a problem that can arise is that if the file system becomes unavailable then the URLs stored in the database will be rendered useless.
The disadvantage of implementing a database system is that its implementation is complex and costly (Anon., Database - Advantages & Disadvantages, n.d.) but would be more appropriate for an organization setting due to its robust features and the security it provides. While a file system is easier and simpler to implement and also allows for quicker access, it should be considered that file systems are prone to security issues (arjay_nacion, 2009).
Part 2
Hashing results in faster queries than indexing when the search is based on equality to a single value (Anon., Indexing & Hashing, n.d.). On the other hand, indexing results in faster queries than hashing when the search is based on a range of values as the specific record can be searched from the minimum to the maximum value.
Some of the criteria that can be used when selecting one or the other are the frequency and the type of queries that need to be run, as previously discussed, and the worst-case access time versus the average access time where hashing has a better average access time but a worse worst-case access time. The frequency of deletion and insertion, as well as the cost of periodic reorganization must also be considered as indexing is more tedious to restructure during insertions, deletions, or reorganizations.
Part 3
1. Data independence is when data is separated from the application. As such, when a change in the data is made, the application is not affected and vice versa. This becomes possible with the use of database management systems, for example, which enable data to be managed separately from the application that uses it (Anon., Database Independence, n.d.)
2. One benefit is that it enables the easy and fast modification of data. Another benefit is that it makes the data accessible to other applications.
3.
a. Designer of the DBMS software
b. User
c. Designer of the DBMS software
d. Programmer of the application software
e. Programmer of the application software
4. 125,000 milliseconds or about 2 minutes
5. The traditional file index merely points to the original data in a specific order. An operating system’s file directory system, on the other hand, also keeps track of the hard drive’s unused spaces. When a file’s size increases, the file directory system relocates the unused space on the hard drive, causing the hard drive to become fragmented. It also ensures that every file is stored somewhere in the hierarchy of directories.
6.
a. A sequential file is good for applications that perform a lot of activities such as when a large amount of data needs to be processed whenever the application is launched or when batch processing tasks are routinely performed (Anon., Traditional File Design, n.d.). Using an indexed file in these cases would result in slower access time.
b. Disk space is more optimized in a sequential file because in a hashed file, physical storage slot is assigned for each possible key even when no data resides in those slots yet. In a sequential file, a slot is allocated for data as it is created.
c. An indexed file allows for random access, which is faster than the sequential access in sequential files.
d. An indexed file allows for faster access when the key is unique, in which case an additional bucket search is required in a hash file. (Brookshear, n.d.)
e. A hash file allows for random access, which is faster than sequential access.
f. A hash file uses less space than an index file as the latter needs extra space and an extra indirection whereas in a hash file, the file’s location is determined directly from the key.
References
arjay_nacion, 2009. Should I Save Images to Database or File System. [online] Available at:
< http://www.sourcecodester.com/article/other/should-i-save-images-database-or-file-system.html> [Accessed 1 March 2012]
Brookshear, J.G., n.d. Overzicht Informatica. [online], Available at: < http://staff.science.uva.nl/~fjseins/Teaching/CollOvInf2004/OvInfC09.ppt> [Accessed 1 March 2012
Data Independence, n.d. [online] Available at:
< http://www.webopedia.com/TERM/D/data_independence.html> [Accessed 1 March
2012]
Database - Advantages & Disadvantages, n.d. [online] Available at:
< http://www.cl500.net/pros_cons.html> [Accessed 1 March 2012]
Indexing &, Hashing, n.d. [online] Available at:
< http://myweb.lmu.edu/dondi/share/db/indexing-and-hashing.pdf> [Accessed 1 March 2012]
Traditional File Design, n.d. [online]. Available at:
< http://www.hit.ac.il/staff/leonidm/information-systems/ch44.html> [Accessed 1 March 2012]