Encyclopedia of Database Systems

Living Edition
| Editors: Ling Liu, M. Tamer Özsu

Active Database Coupling Modes

  • Mikael BerndtssonEmail author
  • Jonas Mellin
Living reference work entry
DOI: https://doi.org/10.1007/978-1-4899-7993-3_503-2

Definition

Coupling modes specify execution points for ECA rule conditions and ECA rule actions with respect to the triggering event and the transaction model.

Historical Background

Coupling modes for ECA rules were first suggested in the HiPAC project [2, 3].

Foundations

Coupling modes are specified for event-condition couplings and for condition-action couplings. In detail, the event-condition coupling specifies when the condition should be evaluated with respect to the triggering event, and the condition-action coupling specifies when the rule action should be executed with respect to the evaluated rule condition (if condition is evaluated to true).

The three most common coupling modes are immediate, deferred, and decoupled. The immediate coupling mode preempts the execution of the transaction and immediately initiates condition evaluation and action execution. In the deferred coupling mode, condition evaluation and action execution is deferred to the end of the transaction (before transaction commit). Finally, in decoupled (also referred to as detached) coupling mode, condition evaluation and action execution is performed in separate transactions.

Specifying event-condition couplings and condition-action couplings in total isolation from each other is not a good idea. What first might seem to be one valid coupling mode for event-condition and one valid coupling mode for condition-action can be an invalid coupling mode when used together. Thus, when combining event-condition couplings and condition-action couplings, not all combinations of coupling modes are valid. The HiPAC project [2, 3] proposed seven valid coupling modes; see Table 1.
Table 1

Coupling modes

 

Condition-action

Event-condition

Immediate

Deferred

Decoupled

Immediate

Condition evaluated and action executed after event

Condition evaluated after event, action executed at end of transaction

Condition evaluated after event, action executed in a separate transaction

Deferred

Not valid

Condition evaluated and action executed at end of transaction

Condition evaluated at end of transaction, action executed in a separate transaction

Decoupled

In a separate transaction: condition evaluated and action executed after event

Not valid

Condition evaluated in one separate transaction, action executed in another separate transaction

  • Immediate, immediate: the rule condition is evaluated immediately after the event, and the rule action is executed immediately after the rule condition.

  • Immediate, deferred: the rule condition is evaluated immediately after the event, and the execution of the rule action is deferred to the end of the transaction.

  • Immediate, decoupled: the rule condition is evaluated immediately after the event, and the rule action is decoupled in a totally separate and parallel transaction.

  • Deferred, deferred: both the evaluation of the rule condition and the execution of the rule action are deferred to the end of the transaction.

  • Deferred, decoupled: the evaluation of the rule condition is deferred to the end of the transaction, and the rule action is decoupled in a totally separate and parallel transaction.

  • Decoupled, immediate: the rule condition is decoupled in a totally separate and parallel transaction, and the rule action is executed (in the same parallel transaction) immediately after the rule condition.

  • Decoupled, decoupled: the rule condition is decoupled in a totally separate and parallel transaction, and the rule action is decoupled in another totally separate and parallel transaction.

The two invalid coupling modes are:
  • Deferred, immediate: this combination violates the semantics of ECA rules, that is, rule conditions must be evaluated before rule actions are executed. One cannot preempt the execution of the transaction immediately after the event and execute the rule action and at the same time postpone the condition evaluation to the end of the transaction.

  • Decoupled, deferred: this combination violates transaction boundaries, that is, one cannot decouple the condition evaluation in a separate and parallel transaction and at the same time postpone the execution of the rule action to the end of the original transaction, since one cannot know when the condition evaluation will take place. Thus, there is a risk that the action execution in the original transaction will run before the condition has been evaluated in the parallel transaction.

Rule actions executed in decoupled transactions can either be dependent upon or independent of the transaction in which the event took place.

The research project REACH (REal-time ACtive Heterogeneous System) [1] introduced two additional coupling modes for supporting side effects of rule actions that are irreversible. The new coupling modes are variants of the detached casually dependent coupling mode: sequential casually dependent and exclusive casually dependent. In sequential casually dependent, a rule is executed in a separate transaction. However, the rule execution can only begin once the triggering transaction has committed. In exclusive casually dependent, a rule is executed in a detached parallel transaction, and it can commit only if the triggering transaction failed.

Cross-References

Recommended Reading

  1. 1.
    Branding H, Buchmann A, Kudrass T, Zimmermann J. Rules in an open system: the REACH rule system. In: Proceedings of the 1st international workshop on rules in database systems, workshops in computing; 1994. p. 111–26.Google Scholar
  2. 2.
    Dayal U, Blaustein BA, Buchmann SC, et al. The HiPAC project: combining active databases and timing constraints. ACM SIGMOD Rec. 1988a;17(1):51–70.CrossRefGoogle Scholar
  3. 3.
    Dayal U, Blaustein B, Buchmann A, Chakravarthy S, et al. HiPAC: a research project in active, time-constrained database management. Technical report. CCA-88-02. Cambridge: Xerox Advanced Information Technology; 1988b.Google Scholar

Copyright information

© Springer Science+Business Media LLC 2017

Authors and Affiliations

  1. 1.University of SkövdeSkövdeSweden

Section editors and affiliations

  • M. Tamer Özsu
    • 1
  1. 1.Cheriton School of Computer ScienceUniversity of WaterlooWaterlooCanada