Database management concepts Database Management Systems (DBMS) An example of a database (relational) Database schema (e.g. relational) Data independence.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

©Silberschatz, Korth and Sudarshan4.1Database System Concepts Lecture-1 Database system,CSE-313, P.B. Dr. M. A. Kashem Associate. Professor. CSE, DUET,
Management Information Systems, Sixth Edition
Introduction to Databases
Oct 31, 2000Database Management -- Fall R. Larson Database Management: Introduction to Terms and Concepts University of California, Berkeley School.
Database Management: Getting Data Together Chapter 14.
Transaction Management and Concurrency Control
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
Synchronization Part 2 REK’s adaptation of Claypool’s adaptation ofTanenbaum’s Distributed Systems Chapter 5 and Silberschatz Chapter 17.
Ch1: File Systems and Databases Hachim Haddouti
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Introduction to Databases Transparencies
“DOK 322 DBMS” Y.T. Database Design Hacettepe University Department of Information Management DOK 322: Database Management Systems.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
An Introduction to Database Management Systems R. Nakatsu.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
IST Databases and DBMSs Todd S. Bacastow January 2005.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
CIS 720 Concurrency Control. Locking Atomic statement –Can be used to perform two or more updates atomically Th1: …. ;……. Th2:…………. ;…….
Module Title? DBMS Introduction to Database Management System.
The University of Akron Dept of Business Technology Computer Information Systems DBMS Functions 2440: 180 Database Concepts Instructor: Enoch E. Damson.
Chapter 2 CIS Sungchul Hong
Chapter 2 Database Environment
Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.
Management Information Systems By Effy Oz & Andy Jones
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Data Dictionary.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
Real-Time & MultiMedia Lab Synchronization Chapter 5.
1 Mutual Exclusion: A Centralized Algorithm a)Process 1 asks the coordinator for permission to enter a critical region. Permission is granted b)Process.
Intro – Part 2 Introduction to Database Management: Ch 1 & 2.
Chapter 1 Introduction Yonsei University 1 st Semester, 2015 Sanghyun Park.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Global State (1) a)A consistent cut b)An inconsistent cut.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
MANAGING DATA RESOURCES ~ pertemuan 7 ~ Oleh: Ir. Abdul Hayat, MTI.
Data resource management
Synchronization Chapter 5. Outline 1.Clock synchronization 2.Logical clocks 3.Global state 4.Election algorithms 5.Mutual exclusion 6.Distributed transactions.
Database Environment Session 2 Course Name: Database System Year : 2013.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
1 Chapter 1 Introduction to Databases Transparencies.
Chapter 9 Database Systems © 2007 Pearson Addison-Wesley. All rights reserved.
Computer Science and Engineering Computer System Security CSE 5339/7339 Session 21 November 2, 2004.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.
Object storage and object interoperability
Introduction to Databases Transparencies © Pearson Education Limited 1995, 2005.
1 Chapter 2 Database Environment Pearson Education © 2009.
Synchronization CSCI 4900/6900. Transactions Protects data and allows processes to access and modify multiple data items as a single atomic transaction.
Chapter 3: Relational Databases
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
Lecture on Synchronization Submitted by
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Introduction to DBMS Purpose of Database Systems View of Data
Chapter 1: Introduction
Chapter 1: Introduction
Database Management System
DBMS SUBMITTED BY :- MADHU MADHAN Lecturer in Computer engg.
Database management concepts
Database management concepts
Chapter 2 Database Environment Pearson Education © 2014.
Course Instructor: Supriya Gupta Asstt. Prof
Presentation transcript:

Database management concepts Database Management Systems (DBMS) An example of a database (relational) Database schema (e.g. relational) Data independence Architecture of a DBMS Types of DBMS Basic DBMS types Retrieving and manipulating data: query processing Database views Data integrity Client-Server architectures Knowledge Bases and KBS (and area of AI)

DBMS tasks: Managing large quantity of structured data Efficient retrieval and modification: query processing and optimization Sharing data: multiple users use and manipulate data Controlling the access to data: maintaining the data integrity An example of a database (relational): Relations (tables) Attributes (columns) Tuples (rows) Example query: Salesperson='Mary' AND Price>100.

Database schema (e.g. relational): Names and types of attributes Addresses Indexing Statistics Authorization rules to access data etc. Data independence: separation of the physical and logical data Particularly important for distributed systems The mapping between them is provided by the schema Architecture of a DBMS - three levels: external, conceptual and internal schema Types of DBMS The data structures supported: tables (relational), trees, networks, objects Type of service provided: high level query language, programming primitives

Basic DBMS types Linear files Sequence of records with a fixed format usually stored on a single file Limitation: single file Example query: Salesperson='Mary' AND Price>100 Hierarchical structure Trees of records: one-to-many relationships Limitations: Requires duplicating records (e.g. many-to-many relationship) Problems when updated Retrieval requires knowing the structure (limited data independence): traversing the tree from top to bottom using a procedural language Network structure: similar to the hierarchical database with the implementation of many-to-many relationships Relational structure Object-Oriented structure Objects (collection of data items and procedures) and interactions between them. Is this really a new paradigm, or a special case of network structure? Separate implementation vs. implementation on top of a RDBMS

Relational structure Relations, attributes, tuples Primary key (unique combination of attributes for each tuple) Foreign keys: relationships between tuples (many-to-many). Example: SUPPLIES defines relations between ITEM and SUPPLIER tuples. Advantages: many-to-many relationships, high level declarative query language (e.g. SQL) SQL example (retrieve all items supplied by a supplier located in Troy): SELECT ItemName FROM ITEM, SUPPLIES, SUPPLIER WHERE SUPPLIER.City = "Troy" AND SUPPLIER.Supplier# = SUPPLIES.Supplier# AND SUPPLIES.Item# = ITEM.Item# Programming language interfaces: including SQL queries in the code

Retrieving and manipulating data: query processing Parsing and validating a query: data dictionary - a relation listing all relations and relations listing the attributes Plans for computing the query: list of possible way to execute the query, estimated cost for each. Example: SELECT ItemNames, Price FROM ITEM, SALES WHERE SALES.Item# = ITEM.Item# AND Salesperson="Mary" Index: B-tree index, drawbacks - additional space, updating; indexing not all relations (e.g. the keys only) Estimating the cost for computing a query: size of the relation, existence/size of the indices. Example: estimating Attribute=value with a given number of tuples and the size of the index. Query optimization: finding the best plan (minimizing the computational cost and the size of the intermediate results), subsets of tuples, projection and join. Static and dynamic optimization

Database views Creating user defined subsets of the database Improving the user interface Example: CREATE VIEW MarySales(ItemName,Price) AS SELECT ItemName, Price FROM ITEM, SALES WHERE ITEM.Item#=SALES.Item# AND Salesperson="Mary" Then the query: SELECT ItemName FROM MarySales WHERE Proce>100 translates to: SELECT ItemName FROM ITEM, SALES WHERE ITEM.Item#=SALES.Item# AND Salesperson="Mary" AND Price>100

Data integrity Integrity constraints: semantic conditions on the data Individual constraints on data items Uniqueness of the primary keys Dependencies between relations Concurrency control Steps in executing a query Concurrent users of the database, interfering the execution of one query by another Transaction: a set of operations that takes the database from one consistent state to another Solving the concurrency control problem: making transactions atomic operations (one at a time) Concurrent transactions: serializability theory (two-phase locking), read lock (many), write lock (one). Serializible transactions: first phase - accumulating locks, second phase - releasing locks. Deadlocks: deadlock detection algorithms. Distributed execution problems: release a lock at one node (all locks accumulated at the other node?) strict two-phase locking

The Transaction Model Examples of primitives for transactions. PrimitiveDescription BEGIN_TRANSACTIONMake the start of a transaction END_TRANSACTIONTerminate the transaction and try to commit ABORT_TRANSACTIONKill the transaction and restore the old values READRead data from a file, a table, or otherwise WRITEWrite data to a file, a table, or otherwise

The Transaction Model a)Transaction to reserve three flights commits b)Transaction aborts when third flight is unavailable BEGIN_TRANSACTION reserve WP -> JFK; reserve JFK -> Nairobi; reserve Nairobi -> Malindi; END_TRANSACTION (a) BEGIN_TRANSACTION reserve WP -> JFK; reserve JFK -> Nairobi; reserve Nairobi -> Malindi full => ABORT_TRANSACTION (b)

Distributed Transactions a)A nested transaction b)A distributed transaction

Writeahead Log a) A transaction b) – d) The log before each statement is executed x = 0; y = 0; BEGIN_TRANSACTION; x = x + 1; y = y + 2 x = y * y; END_TRANSACTION; (a) Log [x = 0 / 1] (b) Log [x = 0 / 1] [y = 0/2] (c) Log [x = 0 / 1] [y = 0/2] [x = 1/4] (d)

Concurrency Control (1) General organization of managers for handling transactions.

Serializability a) – c) Three transactions T 1, T 2, and T 3 d) Possible schedules BEGIN_TRANSACTION x = 0; x = x + 1; END_TRANSACTION (a) BEGIN_TRANSACTION x = 0; x = x + 2; END_TRANSACTION (b) BEGIN_TRANSACTION x = 0; x = x + 3; END_TRANSACTION (c) Schedule 1x = 0; x = x + 1; x = 0; x = x + 2; x = 0; x = x + 3Legal Schedule 2x = 0; x = 0; x = x + 1; x = x + 2; x = 0; x = x + 3;Legal Schedule 3x = 0; x = 0; x = x + 1; x = 0; x = x + 2; x = x + 3;Illegal (d)

Two-Phase Locking (1) Two-phase locking.

Two-Phase Locking (2) Strict two-phase locking.

Data integrity Backup and recovery The problem of keeping a transaction atomic: successful or failed What if some of the intermediate steps failed? Log of database activity: use the log to undo a failed transaction. More problems: when to write the log, failure of the recovery system executing the log. Security and access control Access rules for relations or attributes. Stored in a special relation (part of the data dictionary). Content-independent and content-dependent access control Content-dependent control: access to a view only or query modification (e.g. and-ing a predicate to the WHERE clause) Discretionary and mandatory access control

Knowledge Bases and KBS (and area of AI) Information, Data, Knowledge (data in a form that allows reasoning) Basic components of a KBS Knowledge base Inference (reasoning) mechanism (e.g. forward/backward chaining) Explanation mechanism/Interface Rule-based systems (medical diagnostics, credit evaluation etc.)