Introduction to Data Management. Lecture #2 (Big Picture, Cont.)

Similar documents
Introduction to Data Management. Lecture #2 (Big Picture, Cont.) Instructor: Chen Li

Introduction to Data Management. Lecture #2 Intro II & Data Models I

Database Applications (15-415)

Introduction to Data Management. Lecture #25 (Transactions II)

Introduction to Data Management. Lecture #1 (The Course Trailer )

Introduction to Data Management. Lecture #26 (Transactions, cont.)

Conceptual Design. The Entity-Relationship (ER) Model

Introduction to Data Management. Lecture #5 Relational Model (Cont.) & E-Rà Relational Mapping

Contents. Database. Information Policy. C03. Entity Relationship Model WKU-IP-C03 Database / Entity Relationship Model

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

Introduction to Database Design. Dr. Kanda Runapongsa Dept of Computer Engineering Khon Kaen University

Review The Big Picture

Introduction to Data Management. Lecture #1 (Course Trailer )

Introduction to Data Management. Lecture #1 (Course Trailer )

Introduction to Data Management. Lecture #4 (E-R à Relational Design)

The Entity-Relationship Model. Overview of Database Design

Introduction to Data Management. Lecture #18 (Transactions)

CIS 330: Web-driven Web Applications. Lecture 2: Introduction to ER Modeling

Introduction to Data Management. Lecture #3 (Conceptual DB Design)

Data! CS 133: Databases. Goals for Today. So, what is a database? What is a database anyway? From the textbook:

Introduction to Data Management. Lecture #3 (Conceptual DB Design)

CS/INFO 330 Entity-Relationship Modeling. Announcements. Goals of This Lecture. Mirek Riedewald

The Entity-Relationship Model

The Entity-Relationship Model

Database Management Systems. Syllabus. Instructor: Vinnie Costa

The Entity-Relationship Model

John Edgar 2

What is Data? ANSI definition: Volatile vs. persistent data. Data. Our concern is primarily with persistent data

Chapter 1 Introduction

What is Data? Volatile vs. persistent data Our concern is primarily with persistent data

Principles of Data Management. Lecture #9 (Query Processing Overview)

Introduction to Data Management. Lecture #4 E-R Model, Still Going

CS 146 Database Systems

Overview of Data Management

Database Management Systems MIT Introduction By S. Sabraz Nawaz

Database Systems. Lecture2:E-R model. Juan Huo( 霍娟 )

Outline. Database Management Systems (DBMS) Database Management and Organization. IT420: Database Management and Organization

Overview of Data Management

Introduction to Data Management. Lecture #5 (E-R Relational, Cont.)

Database Applications (15-415)

High Level Database Models

DATABASE MANAGEMENT SYSTEMS

Principles of Data Management. Lecture #2 (Storing Data: Disks and Files)

Introduction to Data Management. Lecture #6 E-Rà Relational Mapping (Cont.)

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

Introduction to Data Management. Lecture #11 (Relational Languages I)

MIS Database Systems.

BIS Database Management Systems.

The Entity-Relationship Model. Overview of Database Design. ER Model Basics. (Ramakrishnan&Gehrke, Chapter 2)

Database Management Systems. Chapter 3 Part 2

CS634 Architecture of Database Systems Spring Elizabeth (Betty) O Neil University of Massachusetts at Boston

Principles of Data Management. Lecture #3 (Managing Files of Records)

CMPT 354 Database Systems I. Spring 2012 Instructor: Hassan Khosravi

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Database Applications (15-415)

Storing Data: Disks and Files

Lecture #16 (Physical DB Design)

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #1: Introduction

EECS 647: Introduction to Database Systems

COMP Instructor: Dimitris Papadias WWW page:

CSE544 Database Architecture

LAB 3 Notes. Codd proposed the relational model in 70 Main advantage of Relational Model : Simple representation (relationstables(row,

Introduction to Data Management. Lecture #1 (Course Trailer ) Instructor: Chen Li

Lecture #8 (Still More Relational Theory...!)

The Entity-Relationship (ER) Model

9/8/2018. Prerequisites. Grading. People & Contact Information. Textbooks. Course Info. CS430/630 Database Management Systems Fall 2018

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Course: Database Management Systems. Lê Thị Bảo Thu

CAS CS 460/660 Introduction to Database Systems. Fall

VARDHAMAN COLLEGE OF ENGINEERING Shamshabad , Hyderabad B.Tech. CSE IV Semester (VCE - R11) T P C 3+1* -- 4 (A1511) DATABASE MANAGEMENT SYSTEMS

CS425 Fall 2016 Boris Glavic Chapter 1: Introduction

Relational Database Systems Part 01. Karine Reis Ferreira

CS430/630 Database Management Systems Spring, Betty O Neil University of Massachusetts at Boston

Introduction to Database Design

Goals for Today. CS 133: Databases. Final Exam: Logistics. Why Use a DBMS? Brief overview of course. Course evaluations

Database Systems Introduction

Database Management Systems. Chapter 1

Introduction to Data Management. Lecture #3 (E-R Design, Cont d.)

CS 445 Introduction to Database Systems

Introduction to Data Management. Lecture 15 (More About Indexing)

Quick Facts about the course. CS 2550 / Spring 2006 Principles of Database Systems. Administrative. What is a Database Management System?

Database Applications (15-415)

BBM371- Data Management. Lecture 1: Course policies, Introduction to DBMS

CPSC 421 Database Management Systems. Lecture 19: Physical Database Design Concurrency Control and Recovery

Department of Information Technology B.E/B.Tech : CSE/IT Regulation: 2013 Sub. Code / Sub. Name : CS6302 Database Management Systems

CSE 132A. Database Systems Principles

CSC 261/461 Database Systems Lecture 20. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

Database Systems. Jan Chomicki. University at Buffalo

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li

Modeling Your Data. Chapter 2. cs542 1

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model

Introduction to Database Systems CS432. CS432/433: Introduction to Database Systems. CS432/433: Introduction to Database Systems

Introduction to Data Management. Lecture 21 (Indexing, cont.)

Introduction to Data Management. Lecture #24 (Transactions)

Conceptual Database Modeling

Introduction: Database Concepts Slides by: Ms. Shree Jaswal

Conceptual Design. The Entity-Relationship (ER) Model

Data Modeling using ER Model

Introduction and Overview

Friday Nights with Databases!

Transcription:

Introduction to Data Management Lecture #2 (Big Picture, Cont.) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v Still hanging in there? (If you might drop, please do it now so others can enroll thanks!) v Today s plan: More detail about DBMS architectures Then on to logical DB design! v Reminder: Sign up on Piazza! (Only ~half have done this!) HW #1 is coming early next week! A new HW turn-in plan is coming soon as well. (J ) v Any lingering Q s from last time? Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 2

Structure of a DBMS v A typical DBMS has a layered architecture. v The figure does not show the concurrency control and recovery components (CS 223). v This is one of several possible architectures; each system has its own variations. Query Optimization and Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management DB These layers must consider concurrency control and recovery Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 3 (CS 122C) DBMS Structure In More Detail Query Parser Query Optimizer Plan Executor Relational Operators (+ Utilities) Files of Records Buffer Manager Access Methods (Indices) Disk Space and I/O Manager SQL Query plans API calls Lock Manager Transaction Manager Log Manager (CS 223) Data Files Index Files Catalog Files WAL Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 4

Components Roles v Query Parser Parse and analyze SQL query Makes sure the query is valid and talking about tables, etc., that indeed exist v Query optimizer (often w/2 steps) Rewrite the query logically Perform cost-based optimization Goal is a good query plan considering Physical table structures Available access paths (indexes) Data statistics (if known) Cost model (for relational operations) SELECT e.title, e.lastname FROM Employees e, Departments d WHERE e.dept_id = d.dept_id AND year (e.birthday >= 1970) AND d.dept_name = Engineering (Cost differences can be orders of magnitude!!!) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 5 Components Roles (continued) v Plan Executor + Relational Operators Runtime side of query processing Query plan is a tree of relational operators (drawn from the relational algebra, which you will learn all about in this class) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 6

Components Roles (continued) v Files of Records OSs usually have byte-stream based APIs DBMSs instead provide record-based APIs Record = set of fields Fields are typed Records reside on pages of files v Access Methods Index structures for lookups based on field values We ll look in more depth at B+ tree indexes in this class (as they are the most commonly used indexes across all commercial and open source systems) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 7 Components Roles (continued) v Buffer Manager The DBMS answer to main memory management! All disk page accesses go through the buffer pool Buffer manager caches pages from files and indices DB-oriented page replacement scheme(s) Also interacts with logging (so undo/redo possible) v Disk Space and I/O Managers Manage space on disk (pages), including extents Also manage I/O (sync, async, prefetch, ) Remember: database data is persistent (!) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 8

Components Roles (continued) v System Catalog (or Metadata ) Info about physical data (volumes, table spaces, ) Info about tables (name, columns, types, ); also, info about their constraints, keys, etc.) Data statistics (e.g., value distributions, counts, ) Info about indexes (types, target tables, ) And so on! (Views, security, ) v Transaction Management ACID (Atomicity, Consistency, Isolation, Durability) Lock Manager for Consistency+Isolation Log Manager for Atomicity+Durability Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 9 Miscellany: A Few Terms v Data Definition Language (DDL) Used to express views + logical schemas (using a syntactic form of a a data model, e.g., relational) v Data Manipulation Language (DML) Used to access and update the data in the database (again in terms of a data model, e.g., relational) v Query Language (QL) Synonym for DML or its retrieval (i.e., data access or query) sublanguage Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 10

Miscellany (Cont d.): Key Players v Database Administrator (DBA) The super user for a database or a DBMS Deals with things like physical DB design, tuning, performance monitoring, backup/restore, user and group authorization management v Application Developer Builds data-centric applications (CS122b!) Involved with logical DB design, queries, and DB application tools (e.g., JDBC, ORM, ) v Data Analyst or End User Non-expert who uses tools to interact w/the data Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 11 A Brief History of Databases v Pre-relational era: 1960 s, early 1970 s v Codd s seminal paper: 1970 v Basic RDBMS R&D: 1970-80 (System R, Ingres) v RDBMS improvements: 1980-85 v Relational goes mainstream: 1985-90 v Distributed DBMS research: 1980-90 v Parallel DBMS research: 1985-95 v Extensible DBMS research: 1985-95 v OLAP and warehouse research: 1990-2000 v Stream DB and XML DB research: 2000-2010 v Big Data R&D (also including NoSQL ): 2005-present Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 12

So Now What? v Time to dive into the first real topic: Logical DB design (ER model) v Read the first two chapters of the book Intro and ER see the syllabus on the wiki v Immediate to-do s for you are: Get yourself signed up on Piazza Stockpile sleep no homework for you yet J v Now - on to DB design! Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 13 Overview of Database Design v Conceptual design: (ER Model used at this stage.) What are the entities and relationships in the enterprise? What information about these entities and relationships should we store in the database? What are the integrity constraints or business rules that hold? A database schema in the ER Model can be represented pictorially (using an ER diagram). Can map an ER diagram into a relational schema (manually or using a design tool s automation). Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 14

ER Model Basics ssn name lot Employees v Entity: Real-world object, distinguishable from all other objects. An entity is described (in DB) using a set of attributes. v Entity Set: A collection of similar entities. E.g., all employees. All entities in an entity set have the same set of attributes. (Until we get to ISA hierarchies J ) Each entity set has a key (a unique identifier); this can be one attribute (an atomic key) or several attributes (a composite key) Each attribute has a domain (similar to a data type). Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 15 ER Model Basics (Contd.) ssn name lot ssn name lot since did dname budget subordinate supervisor Employees Employees Works_In Departments Reports_To v Relationship: Association among two or more entities. E.g., Santa Claus works in the Toy department. v Relationship Set: Collection of similar relationships. An n-ary relationship set R relates n entity sets E1... En; each relationship in R involves entities e1:e1,..., en:en Same entity set could participate in different relationship sets, or in different roles in same set. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 16

Cardinality Constraints ssn name lot since did dname budget v Consider Works_In: An employee can work in many departments; a dept can have many employees. v In contrast, each dept has at most one manager, according to the cardinality constraint on Manages. 1-to-1 (1:1) Employees 1-to Many (1:N) 1 N Manages Many-to-1 (N:1) Departments Many-to-Many (M:N) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 17 Participation Constraints v Does every department have a manager? If so, this is a participation constraint: the participation of Departments in Manages is said to be total (vs. partial). Every Departments entity below must appear in an instance of the Manages relationship Ditto for both Employees and Departments for Works_In ssn name lot since did dname budget Employees 1 N Manages Departments M Works_In N since Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 18

Tune In Next Week v for part two of this riveting, ER modeling cliff-hanger! Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 19