456Chapter 2
456Chapter 2
456Chapter 2
- Data models
A data model is a collection of concepts that can be used to describe the structure of
a database’s information content.
the data types, relationships, and
constraints that should hold on the data
A data model provides the necessary means to achieve some level of data
abstraction.
- A conceptual data model describes a system in terms that its users will
understand such as a diagram that displays the main kinds of objects and their
relationships.
- It should not be too far removed from the way data is organized within the
computer.
- (ex) Relational data model, network model, hierarchical model, and etc.
- A physical data model describes the way in which a logical data model will be
represented in storage (i.e. how data is stored as files in the computer).
- Database Schemas
- An external schema gives each class of users a view of the database that is
trailed to their needs.
- Describes the complete details of data storage and access paths for the database
- The division of the database system into these three levels enables both developers and
users to work within their own levels without having to know the details of the other
levels, and without having to respond to changes in the other levels. Most DBMSs do
6
not separate the three levels completely, but support the three-schema architecture to
some extent.
- Processes of transforming requests and results between levels are called mapping.
- Data Independence
Logical data independence is the capacity to change the conceptual schema without
having to change external schemas or application programs.
Physical data independence is the capacity to change the internal schema without
having to change the conceptual schema.
- The DBMS must provide appropriate languages and interfaces for each category of
users.
(1) Data definition language (DDL)–to define conceptual and internal schemas
(3) View definition language (VDL)–to specify user views and their mappings to the
conceptual schema
● Application programs run on a mainframe and users access them through display
terminals that could perform only data input and display.
● As prices of hardware declined, most users replaced their terminals with PCs and
workstations, and most recently with mobile devices.
● At first, database systems used these computers similarly to how they had used
display terminals.
● The commoditization of the PC and availability of cheap client computers led to the
development of the two-tier architecture (see Figure 2.5, page 48 of the textbook).
● Consists of client computers and server computers, which interact through a well-
defined protocol.
- The client machines provide the user with appropriate interfaces to utilize
servers, as well as with local processing power to run local applications (i.e
“thin-clients”).
- A server is a system containing both hardware and software that can provide
services to the client machines, such as file access, printing, archiving, or
database access.
- More powerful clients that implement both user interface programs and
application programs (i.e. “thick-clients”).
- A client program can actually connect to several RDBMSs and send query and
transaction requests using the ODBC API, which are then processed at the
server sites. Any query results are sent back to the client program, which can
process and display the results as needed.
- Disadvantages: (1) No central place to update and maintain the business logic
since the application code runs at many client sites.
(2) A large amount of trust is required between the server and
the clients.
(ex) The DBMS of a bank has to trust the ATM machine.
- The emergence of the Web changed the roles of clients and servers, leading to
the three-tier architecture.
8
● The business logic layer (a.k.a. application server or web server) runs
application programs and stores business rules (procedures or constraints) that
are used to access data from the database server. It can also improve database
security by checking a client’s credentials before forwarding a request to the
database server.
● The presentation tier displays information to the user and allows data entry.
Users require a natural interface to make requests, provide input, and to see
results. The widespread use of the Internet has made web-based interfaces
increasingly popular.
Network model represents data as record type and also represents a limited type
of 1: N relationship called a set type.
Data models for big data systems such as key-value data model, document data
model, graph data model, column-based data model