Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Course Contents

- Course Objectives /Contents, and Reminding System Analysis, SDLC,


System Modeling,
- System Design Phase,
- The System Technical Architecture,
- The Input Design,
- The Output Design,
- The Interface Design,
- The Data Storage Design,
- The Program Design,

1
Database Design
• Introduction to Data Storage
• Flat Files Data Storage Approach
• Database Approach
• Types of Database Systems
• Data Modeling
• Concepts to Distributed Database
• Introduction to Big Data

2
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.4 File organization and Accessing:


Sequential organization:
 When records are physically in order in a file, the file is said to be a sequential file.
 When a sequential file is updated, it is necessary to go through all the records
preceding the record to be updated.
 This cause bad performance.
 When the file is stored in magnetic tape, there is a need to generate a new file.
 Appropriate when hit rate is very high.
 …
Indexed organization:
 In this case, a set of indexes are created for some attributes in the files that can be
used to accelerate its accessing.
 Appropriate when hit rate is not high.
Indexed-sequential organization:
It is abbreviated as ISAM.
 In these files records are arranged in blocks, and the records within blocks are stored
in order physically.
 But the blocks of records may be in any order.
 Therefore an index is needed to locate the blocks of records.
 … 3
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.4 File organization and Accessing:

Hashed file organization:


It is called also direct organization.
The records of the file is stored directly by using a hash function.
- The accessing of such records is manipulated by the same hash function.
- Appropriate when hit rate is very low.
- …

Linked lists organization:


 It is the files achieved by using a set of pointers to direct processing to the next logical
record located anywhere in the file.
 …

4
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

File Organization and Accessing

Sequential
Indexed Indexes
Indexes
Indexes
System Indexed File Indexes
Indexes
Indexes Flat File
Application Sequential System
Hash
Equation
Linked List
Navigation

5
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

Linked lists organization Approach

Key …………………….. Second.


key
2231 2235
2232 2232
2235 2240
2238 2238
2239 2239
2240 2249
2244 2244
2247 2232
2249 2249

6
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.5 Advantages and Disadvantages of the Flat File Approach

2.5.1 There are some advantages to flat files approach, such as:

• Simplicity of building the system’s files.

• It is cheep than database storage system.

• Simple organization and accessing methods.

• …

7
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.5 Advantages and Disadvantages of the Flat File Approach


2.5.2 Limitations of the Flat File Approach

Separation and Isolation of Data:


In case processing needs data from two or more separate files, it difficult and needs
efforts to define such files then to define them inside the application programs to do
such processing.

Duplication of data:
Often the same information is stored in more than one file. Uncontrolled duplication of
data is not required for several reasons, such as:
• Duplication is wasteful and costs time and money to enter the data more than once
• It takes up additional storage space, again with associated costs.
• Duplication can lead to loss of data integrity; in other words the data is no longer
consistent.

Data Dependence:
• In file processing systems, files and records were described by specific physical
formats into the application program by programmers.
• If the format of the file was changed, the application program should be modified.
• Furthermore, any change in storage structure needs change in the application.

8
Idea Maker Sponsor
data data Separated and Isolated Data

File-1 File-2

Merging File-1
and File-2 is
difficult Processing Needed:
• Retrieve data from File-1
Application
• Retrieve data from File-2
• Merge retrieved data
from both files
• Define the project
feasibility (Decision)

9
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

Sales-File
Duplication of data

Num Name 1998 1999 2000 Activity-File

Num Name Area 2000

Personnel-File

Num Dept Name Address Phone Salary

10
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

The Name
duplication
Sales-File
Duplication of data

Num Name 1998 1999 2000 Activity-File

Num Name Area 2000

The Num
duplication

Note the
duplication
Personnel-File

Num Dept Name Address Phone Salary

11
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

Example
In case of college database,
there may be the number of
applications like General Office,
Library, Account Office, Hostel
etc. Each of these applications
may maintain the following
information into own private
file applications in case of file
management system:

It is clear from the above file systems, that there are some common data
items of the student which has to be mentioned in each application, like
Rollno, Name, Class, Father_Name, Address, Phone_No, Date_of_birth etc.
which are stored repeatedly in file system in each application. It will cause the
problem of redundancy which results in wastage of storage space and
difficulty in maintenance. So, we should look for a solution to these types of
redundancies. The database approach discussed below will help us to provide
the solution for above problems.
12
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.5 Advantages and Disadvantages of the Flat File Approach


2.5.2 Limitations of the Flat File Approach

Difficulty in representing data from the user's view:


Payroll
defining different user views for different users in the same file can not done.
Employee
All rights are allowed,
Salaries data items are not allowed

Payroll File
NID Name Address Salary ….. Payroll Mgr.
All rights are allowed,
All data items are allowed

Data Security.
Embedding security measures and constraints in file or for certain data items in a file is
difficult.

13
2. Flat files Data Storage, Conventional File System, Traditional File System Approach

2.5 Advantages and Disadvantages of the Flat File Approach


2.5.2 Limitations of the Flat File Approach
Concurrency problems. When two transactions have been processed
concurrently, wrong result may result, called data inconsistency .
For example:
Let us consider a scenario where in transaction T1 a user transfers an amount of 1000
from Account A to B (initial value of A is 5000 and B is 8000).
In mean while, another transaction T2, tries to display the sum of account A and B is
also executed. If both the transaction runs in parallel it may results inconsistency as
shown below:
Transaction-1 Transaction-2 Database Status
Withdraw 1000 from A is updated to 4000
account A
Display Sum of accounts A Sum of A+B = 4000+8000 =
and B 12000
Instead of 13000
Deposit 1000 in account B A is updated to 9000

14
End

15

You might also like