DB01 Intro
DB01 Intro
Outline
• Data Models
• Schemas, Instances, and States
• Basic Definitions & Typical DBMS Functionality
• Database and Database Users
• Schemas, Instances, and States
• Three-Schema Architecture
• Data Independence
• Centralized and Client-Server Architectures
• Three-tier client-server architecture
Recent Developments
• Social Networks started capturing a lot of information about people and
about communications among people-posts, tweets, photos, videos in
systems such as:
• Facebook
• Twitter
• Linked-In
• All of the above constitutes data
• Search Engines (Google, Bing, Yahoo, …): collect their own repository of
web pages for searching purposes
Basic Definitions
• Database:
• A collection of related data.
• Data:
• Known facts that can be recorded and have an implicit meaning.
• Mini-world:
• Some part of the real world about which data is stored in a database. For example,
student grades and transcripts at a university.
• Database Management System (DBMS):
• A software package/system to facilitate the creation and maintenance of a
computerized database.
• Database System:
• The DBMS software together with the data itself. Sometimes, the applications are
also included.
• Simplified database
system environment
• Data Abstraction:
• A data model is used to hide storage details and present the users with a
conceptual view of the database.
• Programs refer to the data model constructs rather than data storage details
• Support of multiple views of the data:
• Each user may see a different view of the database, which describes only the
data of interest to that user.
Database Users
• Users may be divided into
• Those who actually use and control the database content, and those who
design, develop and maintain database applications (called “Actors on the
Scene”), and
• Those who design and develop the DBMS software and related tools, and the
computer systems operators (called “Workers Behind the Scene”).
Data Models
• Data Model:
• A set of concepts to describe the structure of a database, the operations for
manipulating these structures, and certain constraints that the database
should obey.
• Data Model Structure and Constraints:
• Constructs are used to define the database structure
• Constructs typically include elements (and their data types) as well as groups
of elements (e.g. entity, record, table), and relationships among such groups
• Constraints specify some restrictions on valid data; these constraints must be
enforced at all times
• Database State:
• The actual data stored in a database at a particular moment in time. This
includes the collection of all the data in the database.
• Also called database instance (or occurrence or snapshot).
• The term instance is also applied to individual database components, e.g. record
instance, table instance, entity instance
Three-Schema Architecture
• Proposed to support DBMS characteristics of:
• Program-data independence.
• Support of multiple views of the data.
• Defines DBMS schemas at three levels:
• Internal schema at the internal level to describe physical storage structures and
access paths (e.g indexes).
• Typically uses a physical data model.
• Conceptual schema at the conceptual level to describe the structure and constraints
for the whole database for a community of users.
• Uses a conceptual or an implementation data model.
• External schemas at the external level to describe the various user views.
• Usually uses the same data model as the conceptual schema.
Data Independence
• Logical Data Independence:
• The capacity to change the conceptual schema without having to change the external
schemas and their associated application programs.
• Physical Data Independence:
• The capacity to change the internal schema without having to change the conceptual
schema.
• For example, the internal schema may be changed when certain file structures are
reorganized or new indexes are created to improve database performance
• When a schema at a lower level is changed, only the mappings between this schema and
higher-level schemas need to be changed in a DBMS that fully supports data
independence.
• The higher-level schemas themselves are unchanged.
• Hence, the application programs need not be changed since they refer to the external
schemas.
DBMS Languages
• Data Definition Language (DDL):
• Used by the DBA and database designers to specify the conceptual schema
of a database.
• In many DBMSs, the DDL is also used to define internal and external schemas
(views).
• In some DBMSs, separate storage definition language (SDL) and view
definition language (VDL) are used to define internal and external schemas.
• SDL is typically realized via DBMS commands provided to the DBA and database
designers
Types of DML
• High Level or Non-procedural Language:
• For example, the SQL relational language
• Are “set”-oriented and specify what data to retrieve rather than how to
retrieve it.
• Also called declarative languages.
• Low Level or Procedural Language:
• Retrieve data one record-at-a-time;
• Constructs such as looping are needed to retrieve multiple records, along
with positioning pointers.
DBMS Interfaces
• Stand-alone query language interfaces
• Example: Entering SQL queries at the DBMS interactive SQL interface (e.g.
SQL*Plus in ORACLE)
• Programmer interfaces for embedding DML in programming languages
• User-friendly interfaces
• Menu-based, forms-based, graphics-based, etc.
• Mobile Interfaces: interfaces allowing users to perform transactions using
mobile apps
• Centralized and
Client-Server DBMS Architectures
Classification of DBMSs
• Based on the data model used
• Legacy: Network, Hierarchical.
• Currently Used: Relational, Object-oriented, Object-relational
• Recent Technologies: Key-value storage systems, NOSQL systems: document
based, column-based, graph-based and key-value based. Native XML DBMSs.
• Other classifications
• Single-user (typically used with personal computers)
vs. multi-user (most DBMSs).
• Centralized (uses a single computer with one database) vs. distributed
(multiple computers, multiple DBs)