CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Active database concepts
Operating System Security
Design Issues for General-Purpose Adaptive Hypermedia Systems Hongjing Wu, Erik de Kort, Paul De Bra Eindhoven University of Technology The Netherlands.
Rasool Jalili; 2 nd semester ; Database Security, Sharif Uni. of Tech. The Jajodia & Sandhu model Jajodia & Sandhu (1991), a model for the application.
1 Constraints, Triggers and Active Databases Chapter 9.
CS240A: Databases and Knowledge Bases From Deductive Rules to Active Rules Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CS240A: Databases and Knowledge Bases From Deductive Rules to Active Rules Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Accounting System Design
SQL Constraints and Triggers
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Transaction Processing Lecture ACID 2 phase commit.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
University of Kansas Construction & Integration of Distributed Systems Jerry James Oct. 30, 2000.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
1 A Closer Look Chapter 2. 2 Underlying Concepts of Databases and Transaction Processing.
CS240A: Databases and Knowledge Bases Applications of Active Database Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts Centralized Systems Run on a single computer system and do not interact with other computer.
CS240A: Databases and Knowledge Bases Time Ontology and Representations Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Transaction Management and Concurrency Control
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Requirements engineering l The process of establishing the services that the.
The chapter will address the following questions:
CS 240A: Databases and Knowledge Bases Introduction to Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE) Datalog.
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
1212 / Department of Computer Science Adaptive Hypermedia 2ID20 Prof. dr. Paul De Bra.
Next-generation databases Active databases: when a particular event occurs and given conditions are satisfied then some actions are executed. An active.
Department of Computer Science and Engineering, HKUST 1 More on Isolation.
DATABASE TRANSACTION. Transaction It is a logical unit of work that must succeed or fail in its entirety. A transaction is an atomic operation which may.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Lecture 1: Overview of CSCI 485 Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA Shahram Ghandeharizadeh Associate.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
Triggers. Why Triggers ? Suppose a warehouse wishes to maintain a minimum inventory of each item. Number of items kept in items table Items(name, number,...)
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 1999 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
DDBMS Distributed Database Management Systems Fragmentation
7 1 Constraints & Triggers Chapter Constraints and triggers? Constraints: Certain properties that the DBMS is required to enforce –E.g. primary.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Topics Related to Attribute Values Objectives of the Lecture : To consider sorting relations by attribute values. To consider Triggers and their use for.
Copyright, Harris Corporation & Ophir Frieder, The Process of Normalization.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
CS 240A: Databases and Knowledge Bases Introduction to Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Session 1 Module 1: Introduction to Data Integrity
Top-K Generation of Integrated Schemas Based on Directed and Weighted Correspondences by Ahmed Radwan, Lucian Popa, Ioana R. Stanoi, Akmal Younis Presented.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
CS240A: Databases and Knowledge Bases Recursive Queries in SQL 2003 Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
Software Engineering, COMP201 Slide 1 Software Requirements BY M D ACHARYA Dept of Computer Science.
CS240A: Databases and Knowledge Bases TSQL2 Carlo Zaniolo Department of Computer Science University of California, Los Angeles Notes From Chapter 6 of.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
PREPARED BY: MS. ANGELA R.ICO & MS. AILEEN E. QUITNO (MSE-COE) COURSE TITLE: OPERATING SYSTEM PROF. GISELA MAY A. ALBANO PREPARED BY: MS. ANGELA R.ICO.
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
Copyright © 2004 Pearson Education, Inc.. Chapter 24 Enhanced Data Models for Advanced Applications.
SDN Network Updates Minimum updates within a single switch
Chapter 8: Concurrency Control on Relational Databases
Databases We are particularly interested in relational databases
Input Space Partition Testing CS 4501 / 6501 Software Testing
Introduction to Database Systems, CS420
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
SQL – Constraints & Triggers
CS240A: Databases and Knowledge Bases TSQL2
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

CS 240A: Databases and Knowledge Bases Analysis of Active Databases Carlo Zaniolo Department of Computer Science University of California, Los Angeles Notes From Chapter 4 of Advanced Database Systems by Zaniolo, Ceri, Faloutsos, Snodgrass, Subrahmanian and Zicari Morgan Kaufmann, 1997

Properties of rule execution  Termination: For any legal transaction, the subsequent rule execution terminates.  Confluence:For any legal transaction, the subsequent rule execution terminates in the same final state.  Identical observable behavior: For any legal transaction, the subsequent rule execution is confluent and produces the same output sequence.

Analysis of Termination An active database has Non­Terminating Behavior iff there exists at least one transaction which produces non­terminating rule processing.  Triggering Graph (TG):  Directed graph {V, E}  Node v i  V correspond to rule r i  R  Arc  r j,r k   E means that the action of rule r j generates events which trigger rule r k  Acyclicity of the triggering graph implies the absence of non-terminating behaviors

Two rules creating an arc CREATE RULE T1 FOR Table1 WHEN... IF... THEN UPDATE Table1.Attr1... CREATE RULE T2 FOR Table1 WHEN UPDATED(Attr1) IF... THEN...

Cyclic Rules  With termination: CREATE RULE SalaryControl ON Emp WHEN INSERTED, DELETED, UPDATED (Sal) IF ( SELECT AVG (Sal) FROM Emp ) > 100 THEN UPDATE Emp SET Sal =.9 * Sal

Cyclic Rules  Without termination: CREATE RULE SalaryControl2 ON Emp WHEN INSERTED, DELETED, UPDATED (Sal) IF ( SELECT AVG (Sal) FROM Emp ) > 100 THEN UPDATE Emp SET Sal = 1.1 * Sal

Improving Rule Analysis  Eliminate edge between two rules when:  The condition of r j is guaranteed to be false after the execution of r i.  The new data produced by r i do not satisfy the condition of r j.

Example of second case: Grade range rules CREATE TRIGGER CheckGradeDomain1 AFTER UPDATE OF Exam ON Grade REFERENCING NEW AS N FOR EACH ROW WHEN (N.Grade > 30) UPDATE Exam SET Grade = NULL WHERE ExamNumber = N.ExamNumber CREATE TRIGGER CheckGradeDomain2 AFTER UPDATE OF Exam ON Grade REFERENCING NEW AS N FOR EACH ROW WHEN (N.Grade < 18) THEN UPDATE Exam SET Grade = NULL WHERE ExamNumber = N.ExamNumber

Analysis of Confluence  Confluence is the property that there only one final result (even when execution is nondeterministic)  This is often called Church-Rosser property, and the Knuth-Bendix algorithm can be used (in some cases) to determine if a given set of rules has this property  Set-oriented Rules (I.e., statement level triggering event)  Confluence is an issue when there is no total order between rules.  For tuple-oriented rules (e.g., for each row) confluence is an issue even if the rules are totally ordered.  In general confluence is hard to assure and might not be necessary.

Confluence (cont.)  Tuple-oriented Rules  Confluence is much harder to ensure; it requires that the final state does not depend on the system's controlled order in which tuples are accessed.  But: Confluence is not necessary or desirable in many cases.  Mutating table exception, when a table that is currently being updated also needs to be changed by a rule; may reveal lack of confluence.  Sufficient condition for confluence: Commutativity of two rules r 1 and r 2 : if for any database state, rule r i and then rule r 1 followed by r 2 produces the same database as r 2 followed by r 1.

Confluence: Commutative Rules create trigger T1 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+1) end; create trigger T2 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+2) end;

Observable Determinism  For every input application, rule processing execution terminates in the same final state with the same output sequence (messages, display activities, reports).  Unlike confluence, observable determinism is neither necessary nor desirable in most cases.  Rules may be confluent but not satisfy observable determinism: create trigger T1 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+1), display(I where integer(I), I=X.A2) end; create trigger T2 for C1 events modify(A1) condition C1(X), X.A1=7 actions modify(C1.A2,X,A2+2), display(I where integer(I), I=X.A2) end;

Modularization Techniques for Active Rule Design  The main problem with rules: understanding their interaction.  This is not just a design issue, but rather a maintenance problem--The AI experience: XCON  Understanding rules after their design is quite hard.  Adding one rule to a rule set may lead to unexpected behaviors.  The main reason: lack of modularization devices for active rules.  Can we improve predictability of active rules by better structuring: next slide.

Eventual consistency From Wikipedia, the free encyclopedia Eventual consistency is used in distributed computing to maximize achieve high availability [as opposed to determinism or serializability--CZ] It guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value. A system that has achieved eventual consistency is often said to have converged, or achieved replica convergence. Analysis based on Datalog and monotonicity in generalized lattices [UCB]

Modularization by Stratification  Stratification: partitioning of rules into disjoint strata such that each strata includes ``uniform'' rules.  Benefit: Rule behavior can be abstracted by:  Reasoning ``locally" on each individual stratum  Reasoning ``globally" of the behavior across strata  A key design principle for providing rule modularization and control.

Rule Debugging and Monitoring  Purpose: run­time debugging and monitoring for tuning active rules' behavior.  Commercial systems lack of debugging and monitoring tools.  Minimum requirement: trace facility­-but even this often unavailable.  Some research prototypes offer powerful debuggers (e.g., Chimera)

Conclusions  Database production rules are:  Very powerful  Very widespread (on almost all relational products)  Very difficult to program—even harder to maintain  Active rule products must be enhanced:  Many products are ``implemented'', with severe limitation and sometimes ill­defined semantics  SQL:1999 is now published cleans up several problems --but many others remain.  Concepts such as stratification will hopefully soon become a widespread notion for improving design  Declarative interfaces are possible for many active database applications integrity constraints, materialized views, virtual views, authorization, dependency control, deduction, versions,workflow management, resource management,....