Beruflich Dokumente
Kultur Dokumente
1 Overview User
Wrapper
Wrapper
Integrator
Metadata
Store
View . . . View
Manager Manager
Query Processor
. . . .
Source Source Sourcen
1 2
tor and wrapper. The monitor is responsible for detecting Views are dened in a subset of SQL that includes select-
modications on the source data and notifying the integra- project-join views and aggregate views over all of the source
tor of them. Currently, we have implemented trigger-based data, without nesting. Optionally, the view denition may
monitors for cooperative (relational) sources, and snapshot also specify which algorithm to use for view consistency.
monitors for
at le sources that only provide periodic snap- When a view is dened, the view specier parses it, adds
shots of the source data. We describe algorithms for ecient relevant information from the meta-data store (e.g., key at-
change detection on snapshots elsewhere [LGM96]. We are tributes, attribute types), and sends it to the integrator.
working on adding IBM's DataCapture to the system; Data- The integrator coordinates system startup, including new
Capture is a log-based monitor which reads the log for DB2 source additions, and view initialization. However, the main
and generates a table of source changes. role of the integrator is to facilitate view maintenance, by
The wrappers translate single source queries from the guring out which source modications need to be propa-
internal relational representation used (which resembles re- gated to which views. To do so, the integrator uses a set
lational algebra) to queries in the native language of its of rules that specify which view managers are interested in
source. For example, a relational database wrapper would which modications. These rules are generated automati-
merely translate the relational algebra expression into SQL. cally from the view tree when each view is dened. In the
A wrapper for a
at le Unix source might translate the simplest case, the rules dictate that all modications to a
algebra expression into a Unix grep for one selection condi- relation over which a view is dened are forwarded to the
tion, use postprocessing to apply further selection conditions corresponding view manager.
and projections, and then transform the result into a rela- There is one view manager module responsible for main-
tion. As stated above, using one wrapper per source hides taining each view, using one of the Strobe algorithms (as
the source-specic querying details from the query proces- specied in the view denition) to maintain view consis-
sor and all other modules: all wrappers support the same tency [ZGMW96]. The dierent Strobe algorithms yield
method interface although their internal code depends on dierent levels of consistency depending on the modica-
the source. tion frequency; all of the algorithms require keeping track
The warehouse wrapper receives view denitions and mod- of the sequence of modications and compensating query
ications to the view data in a canonical (internal) format, results for modications that may have been missed.
and translates them to the specic syntax of the warehouse The query processor receives global queries from the view
database. The wrapper thus shields all other modules in the managers and poses the appropriate single-source queries to
Whips system from the particulars of the warehouse, allow- the source wrappers to answer them. It then passes the com-
ing any database to be used as the warehouse. All modica- posite global query answers back to the view managers. In
tions received by the warehouse wrapper in a single message general, the query processor performs distributed query pro-
are applied to the warehouse in one transaction, as needed cessing, using standard techniques such as sideways informa-
by the Strobe view consistency algorithms [ZGMW96]. tion passing and ltering of selection conditions [OV91] to
prune the queries it poses to the wrappers. It tracks the 2. The integrator determines that the view manager for
state of each global query while waiting for local query re- Bad stocks (VM1) is interested in changes to PE and
sults from the wrappers. forwards the change to VM1. It also determines that
VM2, the view manager for Daily copy, will be unaf-
3 Demo fected by the change and does not notify VM2.
The demo provides a graphical user interface (GUI) to the 3. View manager VM1 receives the update and breaks it
user-visible modules of the Whips system: the view specier, into a deletion of [MSS, 50] from and an insertion of
the sources, and the warehouse; as well as access to a system [MSS, 66] into PE. The deletion can be applied to the
log that records all internal module communication. By warehouse view directly, since MSS is the key for PE.
examining the system log, we can see the sequence of steps However, to compute the view change for the insertion,
in propagating changes. The demo consists of three phases. the join of [MSS, 66] with Daily and Portfolio must
be computed. VM1 sends the query Q = Daily ./
Phase 1: The system is started up and the modules iden- [M SS; 66] ./ P ortf olio to the query processor.
tify themselves to each other. Also, an initial set of 4. The query processor receives Q, extracts from it the
sources is dened. The contents of these sources may single source query Q1 = Daily ./ [M SS; 66], and
then be examined. sends Q1 to the Daily wrapper.
Phase 2: A view is dened at the warehouse. The view
denition triggers the creation of a new view manager, 5. The Daily wrapper computes the answer to Q1 and
which then initializes the view at the warehouse. sends it back to the query processor. The query pro-
cessor then integrates the answer into another single-
Phase 3: Source changes are articially introduced through source query and sends to the Portfolio wrapper: Q2 =
the GUI. We can then see the changes propagated [M SS; 10=26=96; 29:0; 66] ./ P ortf olio. The number
through the modules until the view(s) are updated at 29.0 is the daily closing of MSS on that day.
the warehouse.
6. The Portfolio wrapper computes the answer to Q2 and
The current demo uses a nancial scenario with three sends it back to the query processor. The query pro-
sources: Daily, Price-Earnings, and Portfolio. cessor takes the now complete answer to Q,
[M SS; 10=26=96; 29:0; 66; 73] and sends it back to VM1.
1. Daily is a
at le dump of the daily stock feed. Each
tuple (after conversion to the relational model) con- 7. VM1 receives the answer to Q, notices that it should
tains the date, stock id, high price, low price, closing be in the view. Therefore, VM1 sends to the warehouse
price, and trade volume for a given stock. (In the cur- wrapper the deletion of [MSS, 76] and the insertion of
rent demo, we only include data for 1 day.) [M SS; 10=26=96; 29:0; 66; 73].
2. Price-Earnings (PE) is the current monthly price- 8. The warehouse wrapper receives the updates to view
to-earnings ratio of various stocks, which is a rough Bad stocks and updates the view correctly.
indicator of how good or bad it is to own each stock.
Each tuple contains the stock id and PE for that stock. References
We obtain the PE's from a Dialog source [Kni95].
3. Portfolio is the personal stock portfolio holdings of [CJS+ 94] A. Courtney, W. Janssen, D. Severson, M. Spre-
a customer. Each tuple contains the stock id, price itzer, and F. Wymore. Inter-language unication, re-
paid, number of shares held, and date on which the lease 1.5. Technical Report ISTL-CSA-94-01-01 (Xerox
stock was bought. The Sybase relational database is accession number P94-00058, Xerox PARC, May 1994.
used for the Portfolio source. [Kni95] Knight-Ridder Information, Inc., Dialog Homepage,
The warehouse is also stored in a relational database, 1995. http://www.dialog.com/dialog/dialog1.html.
currently Sybase. During the demo, two views are dened. [LGM96] W. Labio and H. Garcia-Molina. Ecient snap-
Bad stocks is dened as the join of all three source relations shot dierential algorithms in data warehousing. In
where the customer paid more than today's closing price for VLDB Conference, pages 63{74, September 1996.
the stock and the stock's PE is greater than 60. Daily copy
is dened as a copy of the Daily relation. As changes are and P. Valduriez. Principles of Dis-
[OV91] M.T. Ozsu
introduced into the PE and Daily relations during the demo, tributed Database Systems. Prentice Hall, Englewood
these changes are detected and propagated into both views. Clis, NJ, 1991.
4 View maintenance example [WGL+ 96] J.L. Wiener, H. Gupta, W.J. Labio, Y. Zhuge,
H. Garcia-Molina, and J. Widom. A system prototype
The following example illustrates the type of activity that for warehouse view maintenance. In The Workshop on
is visible through our GUI during a WHIPS demonstration. Materialized Views, pages 26{33, Montreal, Canada,
In particular, this example shows in detail how one source June 1996.
update is detected and propagated to the warehouse view. [ZGMW96] Y. Zhuge, H. Garcia-Molina, and J.L. Wiener.
Before this example, the PE for company MSS was 50 and The Strobe algorithms for multi-source warehouse con-
the Bad stocks relation does not contain any tuple for MSS. sistency. In PDIS Conference, pages 146{157, Miami
1. The PE relation is updated: the PE of MSS is changed Beach, Florida, December 1996.
from 50 to 66. The monitor for the PE source detects
this change and reports it to the integrator.