Database Reference
In-Depth Information
Data Storage Requirements
As with gathering read and write data, compiling some data storage re-
quirements early in design will help smooth the physical implementation.
Even during the design phase, knowing ahead of time how much data
you'll be storing can affect some design decisions.
Let's go back to the work-flow application for those high school teach-
ers. Table 5.2 shows the sample data being input for those attendance
records; we'll call this the Attendance entity.
Table 5.2
Sample Data Being Input for Attendance Records
Field Name
Data Type
Description
StudentID
Int
Student identifier
Date
Datetime
Date for attendance record
Class
char(20)
Name of the class attended (or not)
TeacherID
Int
Teacher identifier
Note
char(200)
Notes about the entry (e.g., “tardy due to weather”)
Obviously, there are some assumptions being made here concerning
StudentID and TeacherID (being foreign keys to other entities). For now,
let's focus on the data types that were chosen. As discussed in Chapter 3,
we know the amount of bytes each record in the physical table will occupy.
Here, we have 8 bytes of int data, 220 bytes of char data, and 8 bytes from
the datetime field. Altogether, we have 236 bytes per record. If we have
1,200 students in the school, for each date we have about 283,200 bytes, or
276.56K. The average school year is about 180 days; this is roughly 48MB
of data for a school year. What does this mean to us? The attendance data,
in and of itself, is not likely to be a storage concern. Now, apply this exer-
cise quickly to every entity that you are working on, and you'll find roughly
how much data you'll be storing.
Although this knowledge has huge value during implementation, you
may wonder why we're talking about it now. Suppose that, during the de-
sign phase, you are given a last-minute requirement to change the identity
fields because the new student identifiers require a much longer field.
Now the stakeholders want an alphanumeric ID (for now, we ignore the
merits of such a decision). Suddenly, we're storing a 12-character char field
Search WWH ::




Custom Search