Introduction: management system Introduction s vs. files Basic concepts Brief history of databases Architectures & languages System User / Programmer Application program Software to process queries Software to access stored data Stored Data Stored DB definition (Meta-data) DBMS Software 1.2 Introduction: DBS versus File system Introduction: DBS concepts & architecture Why database systems? Application program DBMS Software - Self-describing nature (schema as meta-data) - Program-data independence - Concurrent access (multiuser, data-sharing) - Multiple views (security) - Fault tolerant (recovery) But sometimes DBS are an overkill Application program Files 1.3 Data model: Important terms! - Collection of concepts used to describe structure of a database (data types, relation, constraints) - Basic operations for specifying retrieval and update Conceptual models - Describes high-level concepts in DB design - Models subset of real world - E.g., entity relationship model student attend lecture name Matr-nr Physical (data)models - Logical description of implementation schema - Five models: network model, hierarchical model, relational model, object-oriented, object-relational title 1.4 1
Introduction: DBS concepts & architecture Introduction: Early databases in the 60 s schema - Description of DB structure - Stored as meta-data - Intensional schema state - = database instance - Data in DB at particular moment - Extensional schema FName Tina Anna Carla Author Name Müller Katz Maus Important terms! Email mueller@... katz@... piep@... 1.5 Hierarchical model (e.g., IMS): Data relationships in trees catalogue Network model (e.g., Codasyl): Data relationships in graphs 1.6 Introduction: relational databases Introduction: databases in the 90 s 1970: Relational model (e.g., system R, Ingres, ) Data in tables [E.F. Codd: The Relational Data Model] FName Tina Anna Carla Author Name Müller Katz Maus 1980: RDBMS everywhere, distributed DBS Email mueller@... katz@... piep@... 1.7 1988: Active databases (e.g., HiPAC) 1990: Object- oriented DBMS (e.g., O 2 ) 1992: Object- Relational DBMSs 1995: Wide scale distribution 1997: Semi-structured data,..., XML / DB 199x: New application areas: Data warehousing, Web and Internet Integration with application software, e.g. SAP R3 uses Oracle (mostly) behind the curtains New challenges: how to deal with text, pictures, video-streams? 1.8 2
Introduction: dominating DBMS Introduction: 3-Schema-Architecture Oracle Informix (IBM) Sybase DB2 (IBM) SQL-Server (Microsoft) personal, low cost desktop DBS: Access (Microsoft) MySQL open source (http://www.mysql.com/) Postgres (http://db.cs.berkeley.edu/postgres.html) 1.9 Goal: separate physical aspects, logical data structuring, and application views on the data External level (views) user-dependent view on data Conceptional level = logical layer logical database schema Internal level physical storage of data user applications user Logical data structure Physical data structure 1.10 Introduction: External Views Introduction: Data independence Example: hospital information system - managing data about patients, doctors, medication etc. - doctors must be able to read the diagnostics - administration must not read the results, but which kind of diagnostics has been performed Two user groups with different views Advantages of external views - Access protection (data privacy) - Data presentation customized for user groups - Independence of users of conceptional schema - Time-consuming mapping - Not supported by all DBMS 1.11 Data independence Important term! - DB level not influenced by changes at other DB level - Interfaces introduce levels of abstraction Logical Data independence - external schema (level) independent of conceptual schema (small changes in database schema invisible for users) - e.g., application independent from data not used by application Physical Data Independence - Conceptual schema independent of internal schema - e.g. hash, B-Tree or sequential access to records should be transparent to the program (ignoring performance impacts) 1.12 3
Introduction: User Groups Introduction: Languages Various end users - Naïve end user: access via application program - Sophisticated end user: changing interactive DB-queries Application Programmer Implementation of complex DB-tasks embedded in application programs designer Responsible for problem analysis, (physical) schema design, user communication, view design (before DB implementation) administrator responsible for authoring access to DB, coordinating and monitoring DB use, security, performance, backup 1.13 Different languages levels of DBS: Data Definition Language (DDL) - Definition of DB schema Data Manipulation Language (DML) - Query database - Update data (insert, change, delete) Data Administration Language - Define access path - Adjust tuning and other parameters Part of the Data model 1.14 Introduction: Languages & Interfaces Introduction: Mainframe Architecture Interactive interfaces for DML Interfaces provided by DBMS for data access, e.g, - Menu-based interfaces for browsing - Forms-based interfaces - Graphical user interface - Interface for DBA Embedded DML Application Programming Interface (API) of DBS for executing commands and transferring the result data - Technically more demanding: result data my be very large set of data, type systems may differ heavily - Most popular: Embedded SQL / C and SQLJ (Java) 1.15 Traditional mainframe architecture Terminals Transaction monitor Applications DBS Operating system - Transaction monitor queues requests, schedules application programs (usually simple application logic) - Very efficient - Still in use today, e.g. flight reservation systems 1.16 4
Introduction: 2-tier Architecture Introduction: 3-tier Architecture Two-tier architecture Client workstation (presentation, requests, GUI) Proprietary protocol - Used with fourth Generation Languages (4GL) i.e. application specific non-procedural languages, easy development of form-based application, e.g., SQL - Transaction support through database system - Used in medium size applications - Decreasing importance because of web-based presentation and standard protocols (http) 1.17 Three-tier Architecture - Separation of presentation, application logic and DB access Browser http Presentation e.g web server Applications - Middle tier must not be a web server: Applet http Application server implements presentation, session control and business logic (applications) JDBC / ESQL/ ODBC Data access transparent for application programs 1.18 Introduction: DB Lifecycle Requirements analysis Conceptual Design Logical Schema Design Physical Schema Design Administration DB designer DB designer 1.19 5