Vous êtes sur la page 1sur 67

Data Bases

Section- I Why do we need data


bases

What is a database
A database is any organized collection of data.
Some examples of databases you may
encounter in your daily life are:

a telephone book
T.V. Guide
airline reservation system
motor vehicle registration records
papers in your filing cabinet
files on your computer hard drive.

Data vs. information:


What is the difference?

What

is data?

What is information?

Data can be defined in


many ways. Information
science defines data as
unprocessed information.

Information is data that


have been organized and
communicated in a
coherent and meaningful
manner.
Data is converted into
information, and
information is converted
into knowledge.
Knowledge; information
evaluated and organized
so that it can be used
purposefully.

Why do we need a database?

Keep records of our:


Clients
Staf
Volunteers
To keep a record of
activities and interventions;
Keep sales records;
Develop reports;
Perform research

Longitudinal tracking

What is the ultimate purpose of a


database management system?

Is to transform
Data

Information

Knowledge

Action

More about database definition

What is a database?
Quite simply, its an organized collection of
data. A database management system
(DBMS) such as Access, FileMaker, Lotus
Notes, Oracle or SQL Server which provides
you with the software tools you need to
organize that data in a flexible manner. It
includes tools to add, modify or delete data
from the database, ask questions (or
queries) about the data stored in the
database and produce reports
summarizing selected contents.

Lets explore some examples

Outlook contacts
Aspira Association MIS
GIS-GPS systems
Customer records

Types of Databases

Non-relational databases
Non-relational databases place information in field categories that
we create so that information is available for sorting and
disseminating the way we need it. The data in a non-relational
database, however, is limited to that program and cannot be
extracted and applied to a number of other software programs, or

other database files within a school or administrative


system. The data can only be "copied and pasted.
Example: a spread sheet

Relational databases
In relational databases, fields can be used in a number of
ways (and can be of variable length), provided that they
are linked in tables. It is developed based on a database
model that provides for logical connections among files
(known as tables) by including identifying data from one
table in another table

Selecting a Database Management System


Database management systems (or DBMSs) can be
divided into two categories -- desktop databases
and server databases.
Generally speaking, desktop databases are
oriented toward single-user applications and reside
on standard personal computers (hence the term
desktop).
Server databases contain mechanisms to ensure
the reliability and consistency of data and are
geared toward multi-user applications.

Selecting a database system: Need Analysis


The needs analysis process will be specific to your
organization but, at a minimum, should answer the following
questions:
How many records we will warehouse and for how long?
Who will be using the database and what tasks will they
perform?

How often will the data be modified? Who will make these
modifications?
Who will be providing IT support for the database?
What hardware is available? Is there a budget for
purchasing additional hardware?
Who will be responsible for maintaining the data?
Will data access be ofered over the Internet? If so, what
level of access should be supported?

Some Definitions

A File: A group or collection of similar records, like


Student File, American History 1850-1866 file,
Basic Food Group Nutrition File
A record book: a "rolodex" of data records, like
address lists, inventory lists, classes or thematic
units, or groupings of other unique records that
are combined into one list (found in AppleWorks,
FileMaker Pro software).
A field: one category of information, i.e., Name,
Address, Semester Grade, Academic topic
A record: one piece of data, i.e., one student's
information, a recipe, a test question
A layout: a design for a database that contains
field names and possibly graphics.

Fundamental building blocks


Tables comprise the fundamental building blocks of any database. If you're
familiar with spreadsheets, you'll find database tables extremely similar. Take a
look at this example of a table sample database:

The table above contains the employee information for our organization -characteristics like name, date of birth and title. Examine the construction of
the table and you'll find that each column of the table corresponds to a specific
employee characteristic (or attribute in database terms). Each row
corresponds to one particular employee and contains his or her information.
That's all there is to it! If it helps, think of each one of these tables as a
spreadsheet-style listing of information.

Where do we start?

Lets explore your


paper system

Client intake forms


Job application form
Funders reports

Database modeling:

Define required fields


from forms or required
reports
Avoid repetition
Keep it simple
Identify a unique
identifier or primary key

Some Quality Control Considerations

Remember garbage in
garbage out. Some
examples and how to
prevent this.
Quality management
encompasses three distinct
processes: quality planning,
quality control, and quality
improvement
Quality Planning in relation
to database systems
design:
Who will perform data
entry?
Training? On-line help?
How data entry will be
performed?

Data entry considerations


Define must enter fields no record is
complete unless: such and such is entered;
Make data entry fool proof. Example:
Grade level can be entered as a number (8
or 8th or eight). By using a pull-down menu
with the correct data format these
mistakes can be avoided.

Data Entry additional considerations

Barcode scanners

USB or
Wireless attached to
a Palm or Pocket PC

Pocket PC

WiFi 802.11g,
Bluetooth
Wireless networks
(real-time on
demand systems)

Summarizing

So what is a database?

According to Oxford English Dictionary:


A structured collection of data held in
computer storage; esp. one that
incorporates software to make it
accessible in a variety of ways

Is every collection of data a


database?

Structure of DB knowledge
Data Base
1. Design

0. Intro
Database
Fundamentals

Conceptual
Modeling
Relational
Model

2. Querying

Query
Languages
Advanced
SQL

3. Applications 4. Advanced
Topics
Java DB
Applications
JDBC

Transaction
Management
Data
Mining

Normalization

Newbie

Users

Designers

Developers

Professionals

Legacy (File-based) Systems


Uncontrolled data redundancy,
Data inconsistency
Poor data sharing
Difficult to keep up with changes
Record format Vs. user requirements
Programs Vs. record format
Low productivity
High maintenance cost

The Database

The data itself PLUS The data


definitions (metadata), applications,
queries and visualizations

Why Databases?
Independence from representation
formats
Control redundancy and consistency
Ensure integrity/security
Better scalability
Allow ad hoc access
Better maintenance
Better concurrency

Other topics

Data Independence
Does data have to be part of
programs?
Do we need to change one if the
other changes?
Three-tier architecture of databases

View

What the users see

Conceptual

How we model data

Physical

How data is stored

Access Flexibility

Easy to ask ad-hoc questions


No need for separate codes
User-friendly interface
Command-based (e.g., SQL)
Graphical (e.g., QBE)

Data Modeling
DATABASE SYSTEM

REALITY
structures
processes

MODEL
data modeling

The model represents a perception of


structures of reality
The data modeling process is to fix a
perception of structures of reality and
represent this perception
In the data modeling process we select
aspects and we abstract

Process Modeling
REALITY
structures
processes

process modeling

DATABASE SYSTEM
MODEL

The use of the model reflects processes of


reality
Processes may be represented by programs
with embedded database queries and updates
Processes may be represented by ad-hoc
DML
database
queries and updatesDML
at run-time
PROG

Database Design
The purpose of database design is to create a database which

is a model of structures of reality


supports queries and updates modeling
processes of reality
runs efficiently

Abstraction
It is very important that the language used for data representation
supports abstraction

We will discuss three kinds of abstraction:

Classification
Aggregation
Generalization

Classification
In a classification we form a concept in a way which allows us to
decide whether or not a given phenomena is a member of the
extension of the concept.

CUSTOMER

Tom

Ed

Nick

...

Liz

Joe

Louise

Aggregation
In an aggregation we form a concept from existing concepts. The
phenomena that are members of the new concepts extension are
composed of phenomena from the extensions of the existing
concepts

AIRPLANE
COCKPIT

WING

ENGINE

Generalization
In a generalization we form a new concept by emphasizing common
aspects of existing concepts, leaving out special aspects

CUSTOMER

1STCLASS

BUSINESS
CLASS

ECONOMY
CLASS

Generalization (cont.)
Subclasses may overlap

CUSTOMER

1STCLASS

BUSINESS
CLASS

Subclasses may have multiple superclasses


MOTORIZED
VEHICLES

TRUCKS

HELICOPTERS

AIRBORNE
VEHICLES

GLIDERS

Relationships Between Abstractions


T

aggregation

generalization

classification

intension

O
Abstraction
classification
aggregation
generalization

O
Concretization
exemplification
decomposition
specialization

extension
O

DATABASE TERMINOLOGY

Data Models
Keys and Identifiers
Integrity and Consistency
Triggers and Stored Procedures
Null Values
Normalization
Surrogates - Things and Names

Data Model
A data model consists of notations for
expressing:

data structures
integrity constraints
operations

Data base architectures

Database System Architectures

Centralized and Client-Server


Systems
Server System Architectures
Parallel Systems
Distributed Systems
Network Types

Centralized Systems

Run on a single computer system and do not


interact with other computer systems.
General-purpose computer system: one to a
few CPUs and a number of device controllers
that are connected through a common bus
that provides access to shared memory.
Single-user system (e.g., personal computer
or workstation): desk-top unit, single user,
usually has only one CPU and one or two hard
disks; the OS may support only one user.
Multi-user system: more disks, more memory,
multiple CPUs, and a multi-user OS. Serve a
large number of users who are connected to

A Centralized Computer System

Client-Server Systems

Server systems satisfy requests


generated at m client systems,
whose general structure is shown
below:

Client-Server Systems (Cont.)

Database functionality can be divided into:

Back-end: manages access structures, query evaluation


and optimization, concurrency control and recovery.
Front-end: consists of tools such as forms, report-writers,
and graphical user interface facilities.

The interface between the front-end and the back-end


is through SQL or through an application program
interface.

Client-Server Systems (Cont.)

Advantages of replacing mainframes with


networks of workstations or personal computers
connected to back-end server machines:
better functionality for the cost
flexibility in locating resources and expanding
facilities
better user interfaces
easier maintenance

Server System Architecture

Server systems can be broadly categorized into


two kinds:
transaction servers which are widely used in
relational database systems, and
data servers, used in object-oriented database
systems

Transaction Servers

Also called query server systems or SQL


server systems

Clients send requests to the server


Transactions are executed at the server
Results are shipped back to the client.

Open Database Connectivity (ODBC) is a C


language application program interface
standard from Microsoft for connecting to a
server, sending SQL requests, and receiving
results.
JDBC standard is similar to ODBC, for Java

Transaction Server Process


Structure

A typical transaction server consists of


multiple processes accessing data in shared
memory.
Server processes

These receive user queries (transactions), execute


them and send results back
Processes may be multithreaded, allowing a single
process to execute several user queries concurrently
Typically multiple multithreaded server processes

Database writer process

Output modified bufer blocks to disks continually

Transaction System Processes


(Cont.)

Data Servers

Used in high-speed LANs, in cases where

The clients are comparable in processing power to


the server
The tasks to be executed are compute intensive.

Data are shipped to clients where processing


is performed, and then shipped results back to
the server.
This architecture requires full back-end
functionality at the clients.
Used in many object-oriented database
systems

Parallel Systems

Parallel database systems consist of multiple


processors and multiple disks connected by a fast
interconnection network.
A coarse-grain parallel machine consists of a
small number of powerful processors
A massively parallel or fine grain parallel
machine utilizes thousands of smaller processors.
Two main performance measures:

throughput --- the number of tasks that can be


completed in a given time interval
response time --- the amount of time it takes to
complete a single task from the time it is submitted

Speed-Up and Scale-Up

Speedup: a fixed-sized problem executing on a small


system is given to a system which is N-times larger.

Measured by:
speedup = small system elapsed time
large system elapsed time
Speedup is linear if equation equals N.

Scaleup: increase the size of both the problem and


the system

N-times larger system used to perform N-times larger job


Measured by:
scaleup = small system small problem elapsed time
big system big problem elapsed time
Scale up is linear if equation equals 1.

Speedup

Scaleup

Factors Limiting Speedup and Scaleup


Speedup and scaleup are often sublinear due to:

Startup costs: Cost of starting up multiple processes may dominate


computation time, if the degree of parallelism is high.

Interference: Processes accessing shared resources (e.g., system bus, disks, or


locks) compete with each other, thus spending time waiting on other processes,
rather than performing useful work.

Skew: Increasing the degree of parallelism increases the variance in service


times of parallely executing tasks. Overall execution time determined by
slowest of parallely executing tasks.

Interconnection Network Architectures

Bus. System components send data on and receive data


from a single communication bus;

Mesh. Components are arranged as nodes in a grid, and


each component is connected to all adjacent
components

Does not scale well with increasing parallelism.

Communication links grow with growing number of


components, and so scales better.
But may require 2n hops to send message to a node (or n
with wraparound connections at edge of grid).

Hypercube. Components are numbered in binary;


components are connected to one another if their binary
representations difer in exactly one bit.

n components are connected to log(n) other components and


can reach each other via at most log(n) links; reduces
communication delays.

Interconnection Architectures

Parallel Database Architectures

Shared memory -- processors share a


common memory
Shared disk -- processors share a common
disk
Shared nothing -- processors share neither a
common memory nor common disk
Hierarchical -- hybrid of the above
architectures

Parallel Database Architectures

Shared Memory

Processors and disks have access to a


common memory, typically via a bus or
through an interconnection network.
Extremely efficient communication between
processors data in shared memory can be
accessed by any processor without having to
move it using software.
Downside architecture is not scalable
beyond 32 or 64 processors since the bus or
the interconnection network becomes a
bottleneck
Widely used for lower degrees of parallelism
(4 to 8).

Shared Disk

All processors can directly access all disks via an interconnection


network, but the processors have private memories.

The memory bus is not a bottleneck


Architecture provides a degree of fault-tolerance if a processor
fails, the other processors can take over its tasks since the database is
resident on disks that are accessible from all processors.

Examples: IBM Sysplex and DEC clusters (now part of Compaq)


running Rdb (now Oracle Rdb) were early commercial users
Downside: bottleneck now occurs at interconnection to the disk
subsystem.
Shared-disk systems can scale to a somewhat larger number of
processors, but communication between processors is slower.

Shared Nothing

Node consists of a processor, memory, and one or more


disks. Processors at one node communicate with another
processor at another node using an interconnection
network. A node functions as the server for the data on
the disk or disks the node owns.
Examples: Teradata, Tandem, Oracle-n CUBE
Data accessed from local disks (and local memory
accesses) do not pass through interconnection network,
thereby minimizing the interference of resource sharing.
an be scaled up to thousands of processors without
interference.
Main drawback: cost of communication and non-local disk
access; sending data involves software interaction at both
ends.

Distributed
Systems
Data
spread over multiple

machines (also referred to as


sites or nodes).
Network interconnects the
machines
Data shared by users on
multiple machines

Distributed
Databases
Homogeneous distributed databases

Same software/schema on all sites, data may be


partitioned among sites
Goal: provide a view of a single database, hiding
details of distribution
Heterogeneous distributed databases
Diferent software/schema on diferent sites
Goal: integrate existing databases to provide useful
functionality
Diferentiate between local and global transactions
A local transaction accesses data in the single
site at which the transaction was initiated.
A global transaction either accesses data in a site
diferent from the one at which the transaction was
initiated or accesses data in several diferent sites.

Trade-offs in Distributed Systems

Sharing data users at one site able to access


the data residing at some other sites.
Autonomy each site is able to retain a degree
of control over data stored locally.
Higher system availability through redundancy
data can be replicated at remote sites, and
system can function even if a site fails.
Disadvantage: added complexity required to
ensure proper coordination among sites.

Software development cost.


Greater potential for bugs.
Increased processing overhead.

Network Types

Local-area networks (LANs) composed of


processors that are distributed over small
geographical areas, such as a single building
or a few adjacent buildings.
Wide-area networks (WANs) composed of
processors distributed over a large
geographical area.

Local-area Network

Networks Types (Cont.)

WANs with continuous connection (e.g., the


Internet) are needed for implementing
distributed database systems
Groupware applications such as Lotus notes
can work on WANs with discontinuous
connection:

Data is replicated.
Updates are propagated to replicas periodically.
Copies of data may be updated independently.
Non-serializable executions can thus result.
Resolution is application dependent.

Vous aimerez peut-être aussi