Top Banner
03/16/22 1 Yan Huang - Introduction Chapter 1: Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components of a DBMS Major Components of a DBMS Three Levels of Abstraction Three Levels of Abstraction
19

10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

Jan 01, 2016

Download

Documents

Wesley Daniels
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 1Yan Huang - Introduction

Chapter 1: IntroductionChapter 1: Introduction

What is a DBMS?What is a DBMS? A little history of DBA little history of DB Major Components of a DBMSMajor Components of a DBMS Three Levels of AbstractionThree Levels of Abstraction

Page 2: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 2Yan Huang - Introduction

What is a DBMS?What is a DBMS?

DDataataBBase ase MManagement anagement SSystemystem A bunch of programsA bunch of programs Users use a language to ask questions Users use a language to ask questions

about data that a DBMS managesabout data that a DBMS manages DBMS understands the language and give DBMS understands the language and give

answers as fast as possibleanswers as fast as possible

Page 3: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 3Yan Huang - Introduction

HistoryHistory 1960s: network model (CODASYL) and hierarchical (IMS). 1960s: network model (CODASYL) and hierarchical (IMS). 1970: E.F. Codd’s seminal paper on relational model for 1970: E.F. Codd’s seminal paper on relational model for

databases databases 1970s: 1970s:

Ingres: Developed at UCB. This ultimately led to Ingres Corp., Ingres: Developed at UCB. This ultimately led to Ingres Corp., Sybase, MS SQL Server, Britton-Lee, Wang's PACE. Sybase, MS SQL Server, Britton-Lee, Wang's PACE.

System R: Developed at IBM San Jose and led to IBM's SQL/DS System R: Developed at IBM San Jose and led to IBM's SQL/DS & DB2, Oracle, HP's Allbase, Tandem's Non-Stop SQL. & DB2, Oracle, HP's Allbase, Tandem's Non-Stop SQL.

1976: P. Chen proposed the Entity-Relationship (ER) model 1976: P. Chen proposed the Entity-Relationship (ER) model 1980s: Commercialization of RDBMS, Oracle was the first1980s: Commercialization of RDBMS, Oracle was the first Early 1990s: OO databasesEarly 1990s: OO databases Mid-later 1990s: Web DB/data warehousing/data miningMid-later 1990s: Web DB/data warehousing/data mining

asp, Front Page, Java Servlets, jsp, JDBC, Enterprise Java Beans, asp, Front Page, Java Servlets, jsp, JDBC, Enterprise Java Beans, ColdFusion, Dream Weaver, Oracle Developer 2000/OLAPColdFusion, Dream Weaver, Oracle Developer 2000/OLAP

Earlier 2000s: consolidation of vendors, IBM (bought Earlier 2000s: consolidation of vendors, IBM (bought Informix), Microsoft, and Oracle. Informix), Microsoft, and Oracle.

Page 4: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 4Yan Huang - Introduction

Major VendorsMajor Vendors

  Overall Unix/Linux Windows

Oracle 32 63.3 34

IBM DB2 (Informix)

34.6 24.7 20.7

SQLServer 16.3 N/A 39.9

Sybase 2.6 ?? ??

Market share $dollas vallue, source CNET May 2002

Page 5: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 5Yan Huang - Introduction

DBMS

Architecture

Page 6: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 6Yan Huang - Introduction

Major Components of a Major Components of a DBMS DBMS

Query processor/QueryQuery processor/Query optimizeroptimizer Transaction managerTransaction manager Security/authorization managerSecurity/authorization manager Storage managerStorage manager

Page 7: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 7Yan Huang - Introduction

Query Processor/OptimizerQuery Processor/Optimizer

Decompose user queries into primitivesDecompose user queries into primitives Find the best way (IO efficient) to execute Find the best way (IO efficient) to execute

the querythe query Two kinds of queries:Two kinds of queries:

DML: data manipulation languageDML: data manipulation language Insert, delete, update, selectInsert, delete, update, select

DDL: data definition languageDDL: data definition language Create/drop/alter a table/index/viewCreate/drop/alter a table/index/view

Page 8: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 8Yan Huang - Introduction

Query LanguagesQuery Languages

SQL: standard/declarative language SQL: standard/declarative language ISO SQL-86, SQL-89, SQL-92, SQL-99, SQL-2003ISO SQL-86, SQL-89, SQL-92, SQL-99, SQL-2003

Example:Example: SELECT name, ageSELECT name, age FROM studentFROM student WHERE gender = “female”WHERE gender = “female”

Supported by most DB vendorsSupported by most DB vendors

Page 9: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 9Yan Huang - Introduction

Query LanguagesQuery Languages

Relational algebra: formal, procedural Relational algebra: formal, procedural languagelanguage

Query by exampleQuery by example Domain relational calculusDomain relational calculus Tuple relational calculusTuple relational calculus DatalogDatalog

Page 10: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 10Yan Huang - Introduction

Transaction ManagerTransaction Manager

A transaction is unit of work either A transaction is unit of work either completed as a full or not at all – atomicity completed as a full or not at all – atomicity

Example transaction:Example transaction: Begin transactionBegin transaction A = A+10A = A+10 B = B – 10B = B – 10 End transactionEnd transaction

Other than atomicity, concurrency control Other than atomicity, concurrency control of transactions is also importantof transactions is also important

Page 11: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 11Yan Huang - Introduction

Concurrency ControlConcurrency Control

Informally, concurrency control means Informally, concurrency control means transactions executing currently should transactions executing currently should not produce results other than a serial not produce results other than a serial execution of the same transactionsexecution of the same transactions

What will happen without concurrency What will happen without concurrency control?control? Partial work will be seen by others – dirty readPartial work will be seen by others – dirty read Your work may be mistakenly over written by Your work may be mistakenly over written by

others – dirty writeothers – dirty write Example?Example?

Page 12: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 12Yan Huang - Introduction

Security/AuthorizationSecurity/Authorization

Define user rolesDefine user roles AdminAdmin UserUser

Define what users can access which part Define what users can access which part of the database system:of the database system: TablesTables IndicesIndices ViewsViews

Page 13: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 13Yan Huang - Introduction

Storage ManagerStorage Manager

Manage how data are stored in physical Manage how data are stored in physical space, e.g. diskspace, e.g. disk

How to read/write dataHow to read/write data We can also create indices on existing We can also create indices on existing

data data Storage of indices need to be managed as wellStorage of indices need to be managed as well

Page 14: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 14Yan Huang - Introduction

Application ArchitecturesApplication Architectures

Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database

Three-tier architecture: E.g. web-based applications, and applications built using “middleware”

Examples of Web application servers are Netscape Application Server, BEA Weblogic Enterprise, Borland AppServer and IBM's WebSphere Application Server

Page 15: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 15Yan Huang - - Introduction

Benefits of DBMSs Compared Benefits of DBMSs Compared to File systemsto File systems

A unified database interface vs. A unified database interface vs. customized programs to interact with datacustomized programs to interact with data

Data integrityData integrity Currency controlCurrency control Specialized fast query answering system, Specialized fast query answering system,

e.g. indexing, query optimizatione.g. indexing, query optimization Example?Example?

Page 16: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 16Yan Huang - Introduction

Database ExamplesDatabase Examples

Human resource systemsHuman resource systems Library systemsLibrary systems Airline reservation systemsAirline reservation systems Product catalogsProduct catalogs Banking systemsBanking systems

Page 17: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 17Yan Huang - Introduction

Three Levels of AbstractionThree Levels of Abstraction

Conceptual layer – things and their Conceptual layer – things and their relationshipsrelationships

Logical layer – how things and their Logical layer – how things and their relationships are specified in a DBMSrelationships are specified in a DBMS

Physical layer – how things and their Physical layer – how things and their relationships are stored in physical space, relationships are stored in physical space, e.g. diskse.g. disks

The separation of these three layers allow The separation of these three layers allow the change of one or more layers without the change of one or more layers without affecting the other layersaffecting the other layers

Page 18: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 18Yan Huang - Introduction

Major Database Major Database Management Systems Management Systems

OracleOracle Microsoft SQL-serverMicrosoft SQL-server IBM DB2 + InformixIBM DB2 + Informix SybaseSybase MySQLMySQL PostgreSQLPostgreSQL XML databases – native xml and relational XML databases – native xml and relational

database extensions to support XMLdatabase extensions to support XML Most have object-relational database extensionsMost have object-relational database extensions Also some main memory databases: timesTen Also some main memory databases: timesTen

(acquired by Oracle recently)(acquired by Oracle recently)

Page 19: 10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.

04/20/23 19Yan Huang - Introduction

In This Class, We WillIn This Class, We Will

Talk about query languages: relational algebra, Talk about query languages: relational algebra, SQLSQL

A logical data layer: relational databaseA logical data layer: relational database How to design a relational databaseHow to design a relational database Basic concepts in object oriented and object Basic concepts in object oriented and object

relational databases (maybe)relational databases (maybe) XMLXML Access Control (indexing)Access Control (indexing) TransactionsTransactions Introduction to data warehousing/data mining if Introduction to data warehousing/data mining if

time permitstime permits