01 Database Management System-TELU (2).pdf
Document Details
Uploaded by PunctualIndianArt629
Telkom University
Full Transcript
Database System 01 | Database Management System Tahun Ajar Ganjil 2024/2025 Oleh: Tim Dosen Goals of the Meeting 01 02 Students understand Students understand the ad...
Database System 01 | Database Management System Tahun Ajar Ganjil 2024/2025 Oleh: Tim Dosen Goals of the Meeting 01 02 Students understand Students understand the advantages of using the components of database systems and database engine, how how the database they worked, and who system evolve from time are the users to time OUTLINES Database Management System Database Engine 9 /1 0/ 2 02 4 Storage Management 5 DATA BA S E MANAGEMENT SYST EM 9 /1 0/ 2 02 4 6 Basic Concepts DBMS contains information about a particular enterprise Collection of interrelated data Set of programs to access the data An environment that is both convenient and efficient to use Database Applications: Banking: transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Online retailers: order tracking, customized recommendations Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions Databases can be very large. Characteristics of the Database Approach Self-describing nature of a database system Insulation between programs and data, and data abstraction Sharing of data and multiuser transaction processing Insulation between programs and data, and data abstraction ADVANTAGES OF US ING DBMS APPROACH Providing Persistent Restricting Unauthorized Controlling Redundancy Storage for Program Access Objects Providing Storage Structures and Search Providing Backup and Providing Multiple User Techniques for Efficient Recovery Interfaces Query Processing ADVANTAGES OF USING DBMS APPROAC H (C ONT.) Representing Complex Relationships among Data Enforcing Integrity Constraints Permitting Inferencing and Actions Using Rules and Triggers Potential for Enforcing Standards. Additional Implications of Using the Reduced Application Development Time. Flexibility. Database Approach Availability of Up-to-Date Information. Economies of Scale H I S TO R Y O F DATA BA S E S YS T E M S Hard disks allowed direct access to data Network and hierarchical data models in widespread use Late 1960s and 1970s 1950s and early 1960s: Late 1960s and 1970s Data processing using magnetic tapes Ted Codd defines the relational data model for storage Would win the ACM Turing Award for this work Tapes provided only sequential accessPunched IBM Research begins System R prototype UC Berkeley (Michael Stone braker) begins Ingres prototype cards for inputan Oracle releases first commercial relational database Punched cards for input High-performance (for the era) transaction processing History of Database Systems Parallel and distributed database systems Wisconsin, IBM, Teradata 1980s 1980s 1980s Research relational prototypes evolve Object-oriented database systems into commercial systems SQL becomes industrial standard H I S TO R Y O F DATA BA S E S YS T E M S SQL reloaded Big data storage systems SQL front end to Map Reduce systems Google BigTable, Yahoo PNuts, Massively parallel database systems Multi-core main-memory databases Amazon, “NoSQL” systems. 2000s 2010s 1990s 2000s Large decision support and data-mining Big data analysis: beyond SQL applications Map reduce and friends Large multi-terabyte data warehouses Emergence of Web commerce DATA BA S E ENGINE 9 /1 0/ 2 02 4 14 DATABASE E N GI N E A database system is partitioned into modules that deal with each of the responsibilities of the overall system. The functional components of a database system can be divided into The storage manager, The query processor component, The transaction management component. STORAGE MANAGER A program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible to the following tasks: – Interaction with the OS file manager – Efficient storing, retrieving and updating of data COMPONE NT OF STORAGE MANAGE R Authorization and integrity manager, which tests for the satisfaction of integrity constraints and checks the authority of users to access data. Transaction manager, which ensures that the database remains in a consistent (correct) state despite system failures, and that concurrent transaction executions proceed without conflicting. File manager, which manages the allocation of space on disk storage and the data structures used to represent information stored on disk. Buffer manager, which is responsible for fetching data from disk storage into main memory, and deciding what data to cache in main memory. The buffer manager is a critical part of the database system, since it enables the database to handle data sizes that are much larger than the size of main memory. DIS K STO RAG E The storage manager implements several data structures as part of the physical system implementation: Data files, which store the database itself. Data dictionary, which stores metadata about the structure of the database, in particular the schema of the database. Indices, which can provide fast access to data items. A database index provides pointers to those data items that hold a particular value. For example, we could use an index to find the instructor record with a particular ID,or all instructor records with a particular name Hashing is an alternative to indexing that is faster in some but not all cases. QUERY PROCESSOR The query processor components include: DDL interpreter, which interprets DDL statements and records the definitions in the data dictionary. DML compiler, which translates DML statements in a query language into an evaluation plan consisting of low-level instructions that the query evaluation engine understands – A query can usually be translated into any of a number of alternative evaluation plans that all give the same result. The DML compiler also performs query optimization; that is, it picks the lowest cost evaluation plan from among the alternatives. Query evaluation engine, which executes low-level instructions generated by the DML compiler Q UERY PRO CES SING 1. Parsing and translation 2. Optimization 3. Evaluation TRANSACTION MANAGEMENT A transaction is a collection of operations that performs a single logical function in a database application Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database. T RANSACT ION SYSTE M PROCESSES TRANSACTION SYSTEM PROCESS STRUCTURE A typical transaction server consists of multiple processes accessing data in shared memory. Server processes – These receive user queries (transactions), execute them and send results back – Processes may be multithreaded, allowing a single process to execute several user queries concurrently – Typically multiple multithreaded server processes Lock manager process Database writer process – Output modified buffer blocks to disks continually TRANSACTION SYSTEM PROCESSES S T R U C T U R E ( C O N T. ) Log writer process – Server processes simply add log records to log record buffer – Log writer process outputs log records to stable storage. Checkpoint process – Performs periodic checkpoints Process monitor process – Monitors other processes, and takes recovery actions if any of the other processes fail E.g., aborting any transactions being executed by a server process and restarting it TRANSACTION SYSTEM PROCESSES S T R U C T U R E ( C O N T. ) Shared memory contains shared data – Buffer pool – Lock table – Log buffer – Cached query plans (reused if same query submitted again) All database processes can access shared memory To ensure that no two processes are accessing the same data structure at the same time, databases systems implement mutual exclusion using either – Operating system semaphores – Atomic instructions such as test-and-set To avoid overhead of interprocess communication for lock request/grant, each database process operates directly on the lock table – instead of sending requests to lock manager process Lock manager process still used for deadlock detection DATA BA S E U S E R S Application programmers interact with system through DML calls Sophisticated users form requests in a database query language write specialized database applications that do not fit into the Specialized users traditional data processing framework Invoke one of the permanent application programs that have been written previously Naïve users E.g. people accessing database over the web, bank tellers, clerical staff Database Administrator DATA BA S E A D M I N I S T R AT O R A person who has central control over the system is called a database administrator (DBA). Functions of a DBA include: Schema definition Storage structure and access-method definition Schema and physical-organization modification Granting of authorization for data access Routine maintenance Periodically backing up the database Ensuring that enough free disk space is available for normal operations, and upgrading disk space as required Monitoring jobs running on the database REFERENCES Silberschatz, Korth, and Sudarshan. Database System Concepts – 7th Edition. McGraw-Hill. 2019. Slides adapted from Database System Concepts Slide. Source: https://www.db-book.com/db7/slides-dir/index.html Elmasri, Navathe, “Fundamental of Database Systems”, Seventh Edition, Pearson, 2015. THANK YOU Database System