2 Database System Concepts And Architecture

Database Management System · Unit 2 · 3 hrs

Database System – Concepts and Architecture

Exam-focused notes for Database System – Concepts and Architecture (Database Management System, CSC265): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.

Database System – Concepts and Architecture in short

This unit looks at how a database system is organized internally: the models used to describe data at different levels of detail, the three-schema architecture that keeps those levels independent of one another, the languages and interfaces a DBMS exposes, and the ways a DBMS can be deployed across one machine or many.

Database System – Concepts and Architecture: notes

Data Models, Schemas, and Instances

Data abstraction is the practice of hiding the details of how data is physically stored while highlighting the features a particular class of user actually needs; it is one of the defining ideas of the database approach and is delivered through three levels: a physical level describing how data is actually stored, a logical level describing what data is stored and how it relates, and a view level describing how individual user groups interact with the system.

A data model is the conceptual toolkit, a collection of concepts for describing the structure of a database (its data types, relationships and constraints) that makes this abstraction possible. Data models are commonly grouped into categories.

Object-based logical models describe data at the logical and view levels with flexible structuring. The entity-relationship (ER) model describes a database as a set of entities (real-world objects, each with a set of attributes such as customer_id, customer_name, customer_address) and the relationships among them, drawn as an ER diagram using rectangles for entity sets, ellipses for attributes, diamonds for relationships and lines connecting them. The object-oriented model likewise organizes data as a collection of objects, but each object bundles together values and the methods (bodies of code) that operate on them, objects can nest arbitrarily deeply, and new classes can be derived from existing ones through inheritance.

Record-based logical models also describe the logical and view levels, but in more implementation-oriented detail: data is organized as fixed-format records, each record type having a fixed number of fields of fixed length. Three models fall under this heading. The hierarchical model arranges records in a tree, with parent-child links where each child has exactly one parent but a parent may have many children. The network model represents records and relates them through links that behave like pointers, letting a record participate in more than one parent-child grouping and so express relationships a strict tree cannot. The relational model represents data as a collection of named tables, each with uniquely named columns; because relationships are expressed through shared key values rather than through embedded pointers, this model is comparatively simple to reason about and to query, which is why it underlies virtually every mainstream DBMS in use today.

A self-describing data model is a semi-structured model, associated with NoSQL and similar systems, in which each stored record carries its own schema information (field names and structure) bundled together with its values, rather than relying purely on a separate catalog.

Because a database changes over time as data is inserted, deleted and updated, two further terms distinguish the data from its shape. The database schema is the overall design, the description of the structure, of the database; it is chosen once at design time and changes only rarely, through explicit schema evolution. A database state, or instance, is the actual set of data the database holds at one particular moment. According to the level of abstraction being described, a schema is further divided into a physical schema (the physical-level design), a logical schema (the logical-level design that application programmers actually build against) and one or more subschemas (view-level descriptions tailored to particular user groups). The logical schema is shielded from the physical schema, so the physical schema can be changed, for performance reasons, say, without forcing any change to the applications built on top of the logical schema.

What this unit covers

  • Data Models, Schemas, and Instances
  • Three-Schema Architecture and Data Independence
  • Database Languages and Interfaces
  • the Database System Environment
  • Centralized and Client/Server Architectures for DBMSs
  • Classification of Database Management Systems

Data Models, Schemas, and Instances

2080 · 5 marks

Define data abstraction, data model, schemas, instances and database state. [5]

--- Data abstraction refers to the process of hiding the complexity of the internal details of how data is stored and maintained, and exposing only the relevant information to the users. A database system achieves this through three levels of abstraction: - Physical Level (Internal Schema): Descr...

Open this answer on its own page →

2079 · 5 marks

What do you mean by Schema and Instance in DBMS? Explain both with examples. [5]

The overall design of the database is called the database schema. It describes the structure, organization, and constraints of the database. The schema is defined at the time the database is designed and does not change frequently. According to the level of abstraction, schemas are divided into t...

Open this answer on its own page →

Three-Schema Architecture and Data Independence

2079 · 10 marks

What is Database Management System? Explain the DBMS architecture with a diagram. What is data independence?[10]

Show solved answer

Database Management System (DBMS) - Model Answer


1. What is a Database Management System? (2 marks)

A Database Management System (DBMS) is a collection of the database, its processing methods, and the set of rules and conditions to be followed for managing data. It is the way to store data and also provides a mechanism for manipulation of data. It is basically a computerized record-keeping system.

In simple terms, a DBMS allows users to:

  • Store data in an organized manner
  • Retrieve data efficiently
  • Manipulate data (insert, update, delete, query)
  • Protect data from unauthorized access and system failures

Examples: Oracle, MS SQL Server, DB2, MySQL


2. DBMS Architecture (Three-Schema Architecture) (5 marks)

The most widely accepted architecture for a DBMS is the Three-Schema Architecture (also called the ANSI/SPARC architecture). It separates the user's view of the database from the physical storage of data.

Diagram

+---------------------------+   +---------------------------+   +---------------------------+
|     External View 1       |   |     External View 2       |   |     External View 3       |
|   (End User / App 1)      |   |   (End User / App 2)      |   |   (End User / App 3)      |
+---------------------------+   +---------------------------+   +---------------------------+
           |                               |                               |
           +-------------------------------+-------------------------------+
                                           |
                              [ EXTERNAL LEVEL ]
                         (Multiple External/User Views)
                                           |
                          External / Conceptual Mapping
                                           |
                              [ CONCEPTUAL LEVEL ]
                              (Conceptual Schema)
                                           |
                          Conceptual / Internal Mapping
                                           |
                               [ INTERNAL LEVEL ]
                               (Internal Schema)
                                           |
                              +------------+------------+
                              |      Stored Database    |
                              +-------------------------+

Description of Each Level

a) External Level (View Level)

  • This is the highest level of abstraction.
  • It describes how individual users or groups of users see the data.
  • Different users may have different views of the same database.
  • Each external view is defined by an external schema (also called a subschema).
  • Example: A student may see only their own marks, while a teacher sees all students' marks.

b) Conceptual Level (Logical Level)

  • This is the middle level of abstraction.
  • It describes what data is stored in the database and the relationships among the data.
  • It is defined by a conceptual schema.
  • It hides the details of physical storage and focuses on the logical structure.
  • Example: Tables, attributes, relationships, constraints.

c) Internal Level (Physical Level)

  • This is the lowest level of abstraction.
  • It describes how data is physically stored on the storage medium.
  • It is defined by an internal schema.
  • It deals with storage allocation, indexing, hashing, etc.
  • Example: File structures, B-trees, storage blocks.

Mappings

The process of transforming requests and results between levels is called mappings:

MappingDescription
External / Conceptual MappingTransforms user view requests to the conceptual schema
Conceptual / Internal MappingTransforms conceptual schema requests to physical storage

Note: The three schemas are only descriptions of data. The actual data is stored at the physical (internal) level only. Most DBMSs do not completely separate the three levels but support this architecture to some extent.


3. Data Independence (3 marks)

Data independence is the capacity to change the schema at one level of a database system without having to change the schema at the next higher level.

It is one of the most important advantages of the three-schema architecture.

There are two types of data independence:


a) Logical Data Independence

"It is the capacity to change the conceptual schema without having to change external schemas or application programs."

  • We may change constraints, add new entities, or reduce the database at the conceptual level.
  • Only the view definition and the external/conceptual mapping need to be updated.
  • Application programs that refer to the external schema remain unaffected.
  • Example: Adding a new attribute (column) to a table should not affect existing user views or application programs.

b) Physical Data Independence

  • It is the capacity to change the internal schema without having to change the conceptual schema.
  • Changes in physical storage (e.g., changing file organization, indexing method) do not affect the logical structure.
  • Only the conceptual/internal mapping needs to be updated.
  • Example: Changing from sequential file storage to indexed storage should not affect the conceptual schema or user views.

Summary Table

TypeChange at LevelNo Change Required at
Logical Data IndependenceConceptual LevelExternal Level / Application Programs
Physical Data IndependenceInternal LevelConceptual Level

Key Point: Data independence is achieved through the three-schema architecture and its mappings. It allows the database to evolve without disrupting existing users or applications, making the system flexible and maintainable.

Open this answer on its own page →

2078 · 5 marks

What is difference between logical data independence and physical data independence? [5]

The capacity to change the schema at one level of a database system without having to change the schema at the next higher level is called data independence. It is one of the major advantages of using a DBMS and is directly related to the three-schema architecture (External, Conceptual, and Inter...

Open this answer on its own page →

2076 · 5 marks

What is data abstraction? What are three levels of data abstraction? Explain. [5]

Data abstraction refers to the hiding mechanism of details of data organization and storage, while highlighting the essential features for an improved understanding of data. It allows users to interact with the database without needing to know how data is physically stored or organized internally...

Open this answer on its own page →

2080.1 · 5 marks

Define data independence. Explain three-schema architecture. [5]

Show solved answer

Data Independence and Three-Schema Architecture


Data Independence

Data independence is the capacity to change the schema at one level of a database system without having to change the schema at the next higher level.

There are two types of data independence:

1. Logical Data Independence

It is the capacity to change the conceptual schema without having to change the external schemas or application programs. For example, we may add new entity types, change constraints, or reduce the database. Only the view definition and mappings need to be updated; the external/user views remain unaffected.

2. Physical Data Independence

It is the capacity to change the internal schema without having to change the conceptual schema (and hence the external schemas also need not change). Changes to the internal schema may be needed because physical files were reorganized or storage structures were modified. As long as the same data remains in the database, the conceptual schema should not need to change.


Three-Schema Architecture

The goal of the three-schema architecture is to separate user applications from the physical database, thereby achieving data independence and data abstraction.

The three schemas are only descriptions of data; the actual data is stored at the physical level only. Requests and results are transformed between levels through a process called mappings.

External Users
      |
  [External Level]  -- External Views (View 1, View 2, ...)
      |
  External/Conceptual Mapping
      |
  [Conceptual Level] -- Conceptual Schema
      |
  Conceptual/Internal Mapping
      |
  [Internal Level]  -- Internal Schema
      |
  Stored Database

Level 1: External Level (View Level)

  • The highest level of abstraction.
  • Describes the part of the database that a particular user group is interested in.
  • Each user group has its own external view (also called a subschema).
  • Hides the rest of the database from that user group.
  • Defined using View Definition Language (VDL).

Level 2: Conceptual Level

  • Describes what data is stored in the database and the relationships among the data for the entire organization.
  • Hides the details of physical storage structures.
  • Represents the logical structure of the whole database (entities, attributes, constraints, relationships).
  • Defined using Data Definition Language (DDL).

Level 3: Internal Level (Physical Level)

  • The lowest level of abstraction.
  • Describes how data is physically stored on storage media (file organization, indexing, access paths, record formats, etc.).
  • Defined using Storage Definition Language (SDL).

Summary Table

LevelAlso CalledDescribesLanguage
ExternalView LevelUser-specific viewsVDL
ConceptualLogical LevelWhole database structureDDL
InternalPhysical LevelPhysical storage detailsSDL

Note: Most DBMSs do not completely and explicitly separate the three levels, but they support the three-schema architecture to some extent.

Open this answer on its own page →