1 of 20

Relational and Distributed Databases

Course Code

CUCS1005

Credits

2+2+0

2 of 20

Relational and Distributed Databases

  • Relational and Distributed Databases is a subject that covers the concepts, design principles, and management techniques of modern database systems. It focuses on storing, organizing, and retrieving data efficiently using relational models and understanding how databases operate across multiple connected locations in distributed systems.
  • The Relational Database part introduces concepts such as tables (relations), tuples, attributes, keys, relational algebra, SQL, normalization, and transaction processing to maintain consistency and integrity.
  • The Distributed Database part explains how data can be stored across multiple networked computers while appearing as a single unified database to users. Topics include fragmentation, replication, distributed query processing, concurrency control, failure recovery, and distributed transaction management.

3 of 20

Overview of Database

4 of 20

Why Databases?

  • Databases manage large volumes of information efficiently.
  • They enable fast and secure access to stored data.

5 of 20

Introduction to Databases

  • A DataBase Management System is a collection of interrelated data and programs.

A Database Management System (DBMS) organizes and manages a large amount of interrelated data. The term interrelated means that pieces of data are connected or associated according to some logical relationships. The DBMS includes software programs that allow users to access, update, and manage this data. Rather than storing data separately in isolated files, a DBMS integrates data so that duplication is reduced and consistency is maintained.

Example:�Consider a university database system. It stores information about students, courses, instructors, and departments. These pieces of data are interrelated:

  • Each student is enrolled in multiple courses
  • Each course is taught by an instructor
  • Each instructor belongs to a department
  • So instead of separate files for students, courses, and faculty, the DBMS stores related tables and allows them to be linked using relationships such as StudentID or CourseID.

  • The DBMS manages all these tables and the connections between them using software programs designed for storage, searching, and consistency.

Student Table

Course Table

Enrollment Table

SID

Name

Dept

6 of 20

Introduction to Databases

  • It helps in storing and retrieving information efficiently.
  • A DBMS provides systematic methods to store large volumes of data so that they can be accessed quickly and accurately when needed. It uses advanced techniques such as indexing, query optimization, caching, and storage management to ensure that data operations (insert, delete, update, search) are performed efficiently. The efficiency becomes more important when multiple users need to access data at the same time.

Example:�Imagine a banking system where thousands of customers access their account details through ATMs or online banking at the same time. When a user searches for their account balance, the DBMS:

  • Locates the correct account records from millions of stored records
  • Retrieves the information within seconds
  • Ensures accuracy and consistency even if multiple updates happen simultaneously
  • Without a DBMS, storing such data in simple files would slow down searching and cause conflicts or inconsistencies.
  • Another example is railway reservation systems where thousands of people search for available seats across different trains. The DBMS processes queries efficiently and returns results instantly using optimized algorithms.

7 of 20

Database Applications

  • Used in banking, airlines, universities, telecom etc.
  • Essential for modern enterprise operations.

8 of 20

Limitations of File Systems

  • Redundancy, inconsistency, and isolation issues.
  • In a file-based data management system, the same data is often stored in multiple files or locations, leading to data redundancy (unnecessary duplication of data). Because copies may not be updated at the same time, data inconsistency occurs, meaning that different versions of the same data may contain conflicting values.�In addition, data stored in separate files becomes isolated, making it difficult to access and combine information since files may be created in different formats and structures without a shared system for integration.

Example

  • If a university stores student personal details in one file and fee records in another separate file, any change in the student’s address must be updated in both places. If one file is updated and the other is not, two conflicting versions exist—this is inconsistency. And because both files are unrelated structurally, retrieving combined information such as students who paid fees by department becomes complex.

9 of 20

Limitations of File Systems

  • Difficult to maintain security and atomic operations.
  • In traditional file systems, enforcing security rules such as who can read, write, or modify specific data is complicated, because control must be coded manually into each application. There is no central mechanism to apply uniform security policies across files.
  • Similarly, it is difficult to guarantee atomicity, meaning a transaction must execute fully or not at all. File systems cannot easily handle situations where a failure happens during an update, leading to partial updates and data corruption. DBMS, instead, uses transaction management and logging to protect data integrity.

Example

  • In a banking system, transferring money ₹5000 from Account A to Account B requires:
  • Deducting amount from A
  • Adding the amount to B
  • If the system crashes after step 1 but before step 2, the system loses money unless atomicity ensures rollback. File systems lack built-in mechanisms for rollback or recovery, while DBMS handles it automatically using transaction logs and ACID properties.

10 of 20

Purpose of DBMS

  • Provides centralized control and consistency of data.
  • Supports concurrent access while maintaining integrity.

11 of 20

View of Data

  • DBMS provides different abstraction levels.
  • Users view only relevant information without complexity.

Levels of Data Abstraction

  • Physical, Logical, and View levels.
  • Higher levels hide internal complexities.

12 of 20

Levels of Data Abstraction

A Database Management System (DBMS) hides the complex internal details of data storage and provides data representation at different levels of abstraction. This layered view allows users to access and interact with data without needing to understand how it is physically stored, ensuring simplicity, security, and flexibility.

DBMS uses three abstraction levels:

1. Internal Level (Physical Level)

  • This level describes how data is actually stored on storage devices such as disks — including file structures, block organization, indexing, compression, and data placement.�Users do not interact with this level directly; it is handled by the DBMS for efficiency.

Example: A user requests a student record, but does not need to know which disk block or page contains the record.

13 of 20

Levels of Data Abstraction

2. Conceptual Level (Logical Level)

  • This level provides a logical view of the entire database, describing what data is stored and the relationships between the data.�
  • It defines tables, attributes, constraints, and relationships without showing physical storage details.

Example: A university database logically represents entities like STUDENT, COURSE, and ENROLLMENT and their relationships, but does not describe how they are stored on disk.

14 of 20

Levels of Data Abstraction

3. External Level (View Level)

  • This is the highest level, presenting customized user-specific views of the database.�Different users see only the data they need, improving security and simplicity.

Example:

  • A student sees only personal details and grades
  • A teacher sees only course and performance records
  • An administrator sees complete data

15 of 20

Instances vs Schemas

  • Schema defines structure; instance is snapshot of data.
  • Schema rarely changes while instance changes frequently.

16 of 20

Data Models

  • Defines structure, constraints, and relationships.
  • Examples: Relational, ER, Object-based, Semi-structured.

17 of 20

Relational Model

  • Represents data using tables called relations.
  • Most widely used model in modern DBMS.

18 of 20

Database Languages

  • DDL (Data Definition Language) defines schema; DML(Data Manipulation Language) manipulates data.

Examples of DDL commands

Examples of DML commands

  • SQL is the most widely used language. SQL is the overall language, and DDL and DML are subsets of SQL.

19 of 20

Database Users

  • Database Administrators, programmers, and end-users.
  • Each interacts with DBMS differently.

20 of 20

Summary

  • Database systems solve key problems of file systems.
  • Essential for efficient information management.