- BeginnerCoder21
File-based system
● Each program within a file based system defines and manages its own data.
● There is no link between those data pools.
● Eg: there are different departments in the bank. Each has its own applications that manage and
manipulate different data files. For banking systems, the programs may be used to debit or credit
an account, find the balance of an account, add a new mortgage loan and generate monthly
statements.
● Advantage
○ Compactness: Data can be stored in a small amount of space or No need of external
storage
○ No need for a highly technical person to handle the database.
○ File Sharing: Data saved in computer-based system files can be shared by several users at
the same time.
○ Processing speed is high as compared to DBMS
○ Low cost (ex: Equipments)
○ Data Retrieval: Computer-based systems offer improved data retrieval techniques that
make it simple and efficient to retrieve data from files.
● Disadvantage
,○ Data redundancy
■ Within an organization, files and applications are created by different
programmers from various departments over long periods of time. This can lead
to data redundancy, a situation that occurs in a database when a field needs to
be updated in more than one table.
■ Can lead to:
● Data Inconsistency: a situation where various copies of the same data
are conflicting, wastes storage space and duplicates effort
● The same information being kept in several different places (files)
○ Data isolation
■ Determines when and how changes made by one operation become visible to
other concurrent users and systems. This issue occurs in a concurrency situation.
Because:
● It is difficult for new applications to retrieve the appropriate data, which
might be stored in various files.
○ Integrity problems
■ It refers to the maintenance and assurance that the data in a database are
correct and consistent.
■ Integrity constraints (e.g., account balance > 0) become "buried" in program
code rather than being stated explicitly
■ Hard to add new constraints or change existing ones
■ Factors to consider when addressing this issue are:
● Data values must satisfy certain consistency constraints that are
specified in the application programs.
● It is difficult to make changes to the application programs in order to
enforce new constraints
○ Security problems
■ There are constraints regarding accessing privileges.
■ Application requirements are added to the system in an ad-hoc manner so it is
difficult to enforce constraints.
○ Concurrency access
■ Ability of the database to allow multiple users access to the same record without
adversely affecting transaction processing
■ A file-based system must manage, or prevent, concurrency by the application
programs
■ Typically, in a file-based system, when an application opens a file, that file is
locked. This means that no one else has access to the file at the same time.
■ Example: Two people reading a balance (say 100) and updating it by
withdrawing money (say 50 each) at the same time
○ Atomicity of updates
■ Failures may leave database in an inconsistent state with partial updates carried
out
, ■ Example: Transfer of funds from one account to another should either complete
or not happen at all.
Database Management System (DBMS)
● collection of interrelated data and a set of programs to store & access those data in an easy and
effective manner.
● provides an interface to perform various operations like database creation, storing data in it,
updating data, creating a table in the database and a lot more.
● The primary goal of a DBMS is to provide a way to store and retrieve database information that is
both convenient and efficient.
● Eg: A DBMS is used by the Personnel Department, the Account Department and the Loan
Department to access the shared corporate database.
● Data
○ Data are factual information such as measurements or statistics about objects and
concepts OR Data is raw, unorganized facts that need to be processed.
○ Data can be something simple, random and useless until it is organized.
○ Data can be a person, a place, an event, an action or any one of a number of things.
○ A single fact is an element of data, or a data element.
● Information
○ When data is processed, organized, structured or presented in a given context to make it
useful, it is called information
● Eg: MySQL, Oracle, etc are a very popular commercial database which is used in different
applications.
Field
● Components that provide structure for a table.
● Fields are organized into records, which contain all the information within the table relevant to a
specific entity.
Record
● A record is also known as a tuple(row).
● Refers to a collection of items or data organized within a table within a set of fields related to a
particular topic or theme
File
● A file is a sequence of records stored in binary format.
Field vs Record vs File
● A field is a single piece of information
● Record is one complete set of fields
● File is a collection of records.
, ● For example, a telephone book is analogous to a file. It contains a list of records, each of which
consists of three fields: name, address, and telephone number.
Database
A database is a collection of interconnected data that is used to efficiently retrieve, insert, and delete
data. It’s also used to arrange data into tables, schemas, views, and reports, among other things.
● Properties
○ A database is logical, coherent and internally consistent.
○ It is a representation of some aspect of the real world or a collection of data elements
(facts) representing real world information
○ A database is designed, built and populated with data for a specific purpose.
○ Each data item is stored in a field.
○ A combination of fields makes up a table. For example, each field in an employee table
contains data about an individual employee.
● Eg:
○ Airlines: reservations, schedules
○ Universities: registration, grades
The university database organizes the data about students, faculty, and admin staff etc.
which helps in efficient retrieval, insertion and deletion of data from it.
○ Sales: customers, products, purchases
○ Online retailers: order tracking, customized recommendations
○ Manufacturing: production, inventory, orders, supply chain
○ Human resources: employee records, salaries, tax deduction
File based vs DBMS
File based DBMS
A file system is a software application that A database management system, or DBMS, is a
organizes and maintains files on a storage device. software application that allows you to access,
It manages the storage and retrieval of data. create, and manage databases.
Redundant data can be present in a file system. In DBMS there is no redundant data.
It doesn’t provide backup and recovery of data if It provides backup and recovery of data even if it
it is lost. is lost.
There is no efficient query processing in the file Efficient query processing is there in DBMS.
system.
less data consistency in the file system. more data consistency because of the process of
normalization.