This document provides an overview of database concepts and architecture, covering topics such as databases, DBMS, data models, schemas, and instances. It explains the three-schema architecture, data independence, database languages, and interfaces, as well as the components of a database system. Additionally, it discusses centralized and client/server architectures for DBMSs and classifies DBMS based on data models, users, and location.
This document provides an overview of database concepts and architecture, covering topics such as databases, DBMS, data models, schemas, and instances. It explains the three-schema architecture, data independence, database languages, and interfaces, as well as the components of a database system. Additionally, it discusses centralized and client/server architectures for DBMSs and classifies DBMS based on data models, users, and location.
Unit 1: Database Concepts and Architecture (5 Lecture Hours)
1. Introduction to Database and DBMS
• Database: o A database is a structured collection of data that is stored and managed to serve multiple purposes. It organizes data in such a way that it can be easily accessed, retrieved, updated, and managed. o Databases are used in various applications like banking, education, healthcare, and e-commerce for efficient data management. • Database Management System (DBMS): o A DBMS is software that interacts with the database, users, and applications to capture and analyze data. It provides an interface for users to perform operations like storing, retrieving, and updating data. o Examples: MySQL, Oracle, Microsoft SQL Server, MongoDB, etc. • Database Users: 1. End Users: Individuals who interact with the database to perform specific tasks like querying or updating data. For example, customers using an e-commerce platform. 2. Database Administrators (DBAs): Professionals responsible for managing the overall database environment, ensuring security, availability, and performance. 3. Application Developers: Programmers who build applications that interact with the database. 4. System Analysts: Individuals who design database structures based on organizational needs. • Benefits of Databases: 1. Data Centralization: All data is stored in a central location, making it easier to manage and access. 2. Data Integrity: Ensures accuracy and consistency of data. 3. Data Security: Provides controlled access to data, ensuring that only authorized users can access or modify it. 4. Data Sharing: Multiple users can access the database simultaneously without conflicts. 5. Reduced Redundancy: Eliminates duplicate data storage by maintaining a single version of data. 6. Scalability: Supports growing amounts of data and increasing numbers of users efficiently. 2. Data Models, Schemas, and Instances • Data Models: o Data models define how data is structured, stored, and manipulated in a database. They act as blueprints for creating and managing databases. o Types of Data Models: 1. Hierarchical Model: Organizes data in a tree-like structure with parent-child relationships. 2. Network Model: Uses graph structures with nodes (entities) and edges (relationships) to represent data. 3. Relational Model: Represents data in the form of tables (relations) with rows and columns. This is the most commonly used model. 4. Object-Oriented Model: Integrates object-oriented programming concepts like classes and objects into databases. • Schema: o A schema is the logical structure or blueprint of a database that defines how data is organized. o Types of Schemas: 1. Physical Schema: Describes how data is stored physically on storage devices. 2. Logical Schema: Describes the overall design of the database, focusing on data organization and relationships. 3. View Schema: Represents how data is presented to end users or applications. • Instance: o Refers to the actual data stored in the database at a specific moment in time. It is a snapshot of the database. 3. Three-Schema Architecture and Data Independence • Three-Schema Architecture: o This architecture separates the database into three levels to simplify data management and ensure flexibility: 1. Internal Level: Describes how data is physically stored, including file structures and storage formats. 2. Conceptual Level: Describes the logical structure of the database, including entities, attributes, and relationships. 3. External Level: Describes how data is viewed by individual users or applications. • Data Independence: o Refers to the ability to change one schema level without affecting other levels. 1. Logical Data Independence: Changes in the conceptual schema (e.g., adding a new table) do not affect the external schema. 2. Physical Data Independence: Changes in the internal schema (e.g., changing storage formats) do not affect the conceptual schema. 4. Database Languages and Interfaces • Database Languages: o Used to define, manipulate, and control data within a database. 1. Data Definition Language (DDL): Defines the structure of the database. Commands: CREATE, ALTER, DROP. 2. Data Manipulation Language (DML): Used to retrieve, insert, update, and delete data. Commands: SELECT, INSERT, UPDATE, DELETE. 3. Data Control Language (DCL): Manages user permissions and access. Commands: GRANT, REVOKE. 4. Transaction Control Language (TCL): Manages transactions. Commands: COMMIT, ROLLBACK, SAVEPOINT. • Interfaces: 1. Command-Line Interface (CLI): Allows users to interact with the database through textual commands. 2. Graphical User Interface (GUI): Provides a visual interface with menus and icons for easier interaction. 3. Application Program Interface (API): Enables applications to interact with the database programmatically. 5. Database System Environment • A database system comprises several components: 1. Hardware: Physical devices like servers, storage devices, and networking equipment. 2. Software: Includes the DBMS software and application programs. 3. Data: The actual information stored in the database. 4. Users: Individuals or systems interacting with the database. 5. Procedures: Guidelines for database usage and management. 6. Centralized and Client/Server Architectures for DBMSs • Centralized Architecture: o All data and DBMS functionality are located on a single central server. o Advantages: Simplicity, easier management, and data consistency. o Disadvantages: Single point of failure, scalability limitations. • Client/Server Architecture: o Divides the database system into two parts: 1. Client: Handles user interface and application logic. 2. Server: Manages data storage, query processing, and transaction management. o Advantages: Scalability, better resource utilization, and distributed processing. o Disadvantages: Complexity in setup and management. 7. Classification of Database Management Systems • DBMS can be classified based on various criteria: 1. Data Models: ▪ Relational DBMS: Uses tables to represent data. Example: MySQL, PostgreSQL. ▪ NoSQL DBMS: Handles unstructured or semi-structured data. Example: MongoDB, Cassandra. ▪ Object-Oriented DBMS: Integrates object-oriented programming features. Example: db4o. 2. Users: ▪ Single-User DBMS: Supports one user at a time. Example: MS Access. ▪ Multi-User DBMS: Supports multiple users simultaneously. Example: Oracle DB. 3. Location: ▪ Centralized DBMS: Data is stored in one central location. ▪ Distributed DBMS: Data is distributed across multiple locations and systems. This detailed explanation provides a comprehensive understanding of database concepts and architecture, making it suitable for both exam preparation and practical knowledge.