Active Databases
Active Databases
By,
Radhika Kumaran
09MW13
Passive DBMS Vs Active DBMS
Conventional DBMS are passive: they execute
operations only upon explicit request
Inventory
Product Quantity
ADBS x 5
Order 100 items of
product x 3
Active Rule
A
Sale of 2 items of
product x
Applications Of Active Databases
The following are the common application:
integrity constraints
alerting
auditing
security
statistics
views
Approaches to implement applications
requiring automatic execution of actions
There are three main approaches to
implement the concept in question
Passive approach (two application
method)
Passive approach (one application
method)
Active approach
Architectural approaches
Approach 1 :Passive DBMS: (two types of
application)
check
Applications Applications
(updates) Passive DBMS periodic
reply
polling
●
Problem:
●
It compromises code modularity and re-usability
●
If the monitored condition changes, the application has to
be changed
Architectural approaches
Active DBMS (integrated approach)
Specification of the situations
to be monitored
Queries and
(re) actions updates
Active DBMS
External Events
Active databases
UPDATE DEPARTMENT
SET Total_sal = Total_sal + NEW. Salary
The
WHERE Dno = NEW.Dno; action
Condition
Action can be
One SQL statement
A sequence of SQL statements enclosed
between a BEGIN and an END
Action specifies the relevant modifications
Active Database Concepts and
Triggers
Detached consideration
Types of Events
Immediate consideration
Part of the same transaction and can be one of the
following depending on the situation
Before
After
Instead of
Deferred consideration
Condition is evaluated at the end of the transaction
Detached consideration
Condition is evaluated in a separate transaction
Active Database Concepts and
Triggers
Potential Applications for Active Databases
Notification
Automatic notification when certain condition occurs
Enforcing integrity constraints
Triggers are smarter and more powerful than constraints
Maintenance of derived data
Automatically update derived data and avoid anomalies
due to redundancy
• E.g., trigger to update the Total_sal in the earlier example
Thank you