22 Oct 2015

Active Database Systems (Widom)

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2910

integrating a production rules facility into a database system … provides … database features including integrity constraint enforcement, derived data maintenance, triggers, alerts, … In addition, a database with rule processing capabilities provides a useful platform for large and efficient … system. Database with production rules are referred to as active databases

conventional database systems are passive: they only execute queries or transactions explicitly submitted by a user or an application program. For many applications, however, it is important to monitor situations of interest, and to trigger a timely response when the situation occur.

event-condition-action
is of the form: condition → action
the desired behavior is expressed production rules, defined and stored in the database
has the benefit that the rules can be shared by many application programs, and the database can optimize their implementations

a reference engine cycles through all the rules in the system … Of all the rules that match (the condition set), one is selected using some conflict resolution policy …

2 rule models and languages

rule conditions
in commercial system and PostgresSQL …, are arbitrary predicates over the database state …
rule actions
arbitrary sequences of retrieval and modification commands … also may specify rollback to abort the current transaction

2.4 event-condition-action binding

a link between the data that matches a rule’s condition and the behavior of the rule’s action

PostgresSQL event-condition-action binding
to reference the modified tuple before and after the triggering event, PostgresSQL uses the special tuple variables NEW and OLD

3 rule execution semantics

interplay between rule execution and the execution of user-initiated transactions is also an issue

3.2 PostgresSQL

tuple-oriented processing

rule processing in PostgresSQL is inherently recursive and synchronous (similar to a procedure call mechanism)

4.1 Characteristic of representative systems

in PostgresSQL, two different mechanisms are implemented for rules: tuple-level processing and query rewrite

4.2 Rule programming support

features for analyzing rule processing include the ability to trace rule execution, to display the current set of triggered rules, to query and browse the set of rules, and to cross-reference rules and data …

rule termination