Discuss the pros and cons of using fix-format fix-length records. Give at least 2 points for each and justify the points you give.
(issues involved with complexity of implementation, space usage and efficiency, flexibility, etc.)
You are designing a file system for a medical application. Each patient record has 10 fields that always occur (e.g., name, patient number) and 40 fields that may or may not be relevant or known for a patient (e.g., number of children given birth to, cholesterol level). Assume that each of the optional fields is relevant or known for a particular patient with probability p. The values for all fields are a fixed size of 10 bytes.
You are considering two options:
(i) A fixed format record.
(ii) A variable format record where all fields are tagged.
Each tag is N byte.
a. What is the expected size of a record for each option?
Your answer may be a function of p and N.
Fixed format record: (10+40)*10 = 500Bytes
Variable format record: 10*(10+N)+40*p*(10+N) Bytes
b. Given that N=2 byte, for what range of p values is the fixed-format
format option best?
500 < 10*12+40*p*12
-> 500 < 120 + 480*p
-> (380/480) < p <= 1
-> 19/24 < p <= 1
Given that p=0.75, for what range of N values is the variable-format
500 > 10*(10+N) + 40*0.75*(10+N)
-> 500 > 100 + 10*N + 300 + 30*N
-> 100 > 40 * N
-> 100/40 > N
-> 2.5 > N
Therefore, N=1 or N=2
(c. Think of a third option to group the fixed/optional fields into a
record and specify your design. ? Hybrid format…) -> needed?
Thanks for visiting this post for Data Storage Problem solving articles. You can also visit Data Storage Tutorial Listing page for more articles on Data Storage.
Happy Learning 🙂 for Data storage problem-solving numerical.
Your comments are welcome to improve this post. happy learning 🙂