Title: Querying the Physical World: The COUGAR Project
1Querying the Physical WorldThe COUGAR Project
- Philippe BonnetJohannes Gehrke
- Praveen Seshadri
- CORNELL University
2Outline
- 1 Device networks represent a new and exciting
application domain for database technology - 2 The COUGAR device database system transfers
existing techniques in this new context - 3 Device Database Systems raise new challenges
3Device-based applications
- Environmental applications
- Flood detection, volcano monitoring, plant
breeding, - Surveillance applications
- Tactical information systems, building
surveillance, Centrale Nationale dAlarme, - Control applications
- Traffic control in a large city, warehouse
monitoring,
4Catalog of Devices
5Are Devices Clients or Servers?
- Scenario 1
- DB server hold primary copy of the data
- Devices replicate data
- Devices support user interaction
- Scenario 2
- Devices hold primary copy of the data
- Users access large collection of devices
6Classification of Devices
7Wireless Integrated Network Sensor
Sensoria.com WINS NG Architecture
8Wireless Sensor Network Characteristics
- Cost of communication is orders of magnitude
higher than cost of local computation on devices - Cost of communication with neighbor devices is
lower than cost of communication with distant
devices
9Access to Device Networks
- Access to large collection of devices
- Associative access independent of the physical
organization - Users formulate queries regardless of the device
network organization
10Declarative Access to Device Networks
- Aggregate Queries over Historical Data
- Give me the average rainfall level in California
for 1999 - Snapshot queries about the current state of the
device network - What is the current rainfall level in California?
- Long-running queries for monitoring the device
network - Tell me whenever two rainfall sensors in the same
area detect an abnormal rainfall level.
11Database Approaches for accessing Device Networks
- Warehousing approach
- Device data is extracted in a predefined way
- Device data is stored in a centralized DB server
- Queries are evaluated on the centralized DB
server - Distributed approach
- Queries are evaluated by contacting devices
- Portions of queries are executed on the devices
-
12Device Database System
- Access to devices is dictated by the query
workload - Trade-off between local computation on devices
and reduced communication
13Candidate Techniques (1)
- (Re-)active database systems
- Active rules to implement propagation
- Rich expressive power of active rules is not
required - No mechanisms for execution of active rules in a
distributed context - Continuous queries over append-only relations
- Mechanism for propagation of insertions
integrated with SQL query execution - Defined in a centralized context
14Candidate techniques (2)
- Distributed Database Systems
- Techniques for balancing local computation and
communication - Assume that a limited number of full-fledged
database systems is tightly interconnected - No support for long-running queries
- Mediator Systems
- Represent devices as data sources with possibly
limited capabilities - Limited range of join execution techniques in
existing systems, data from distinct sources is
always joined on the mediator
15The COUGAR Approach
- How to represent devices?
- Schema
- Internally
- How to formulate long-running queries?
- How to evaluate long-running queries in a
distributed context?
16Devices as Abstract Data Types
- A device provides a set of functions
- Synchronous continuous phenomenon
- Asynchronous threshold events
- To each device type is associated an Abstract
Data Type - Device ADT method represent device functions
- e.g., getTemperature() detectTempGreaterThan(90)
17Device ADT Methods as Virtual Relations
- R.dev.getTemperature(90) R
VRGetTemperature
- Base relation
- Located on front-end
- Virtual relation
- Append-only
- Partitioned across devices
18Long-running queries
- Snapshot and long-running queries expressed in
SQL with slight modification of the language - WHERE clause event condition
- SELECT clause action
- New statements for creation, deletion and
evaluation (for a given duration) of long-running
queries - User-defined function for representing interval
between successive invocation of device functions - Implicit conditions on timestamped relations
19Examples of Long-running queries
- CREATE LR_QUERY q1 AS
- SELECT R.dev, R.dev.getTemperature()
- FROM TempSensors R, NamedPlaces N
- WHERE every(30)
- AND R.dev.location().inside(N.bbox) AND
N.name California - CREATE LR_QUERY q2 AS
- SELECT R1.dev.location()
- FROM TempSensors R1, TempSensors R2
- WHERE every(0)AND R1.dev.detectAbnormalTemperatu
re()AND R2.dev.detectAbnormalTemperature()AND
R1.dev R2.dev
20Query Execution Plan
- Virtual Scan Blocking read operator to implement
propagation of insertions in (append-only)
fragments of virtual relations - Similar to fetch_wait operator defined in Alert
- Distributed joins involving
- A base relation and a virtual relation
- Two virtual relations
21Query Execution Plan
- Constraints on joins involving virtual scans
- Join on partitioned relations
- Virtual relations cannot be scanned repeatedly
- Index join (or dependent join) is required if
virtual relation input attribute is bound - No materialization of virtual relations
22Distributed Join Techniques
- Base Relation Virtual Relation
- With or without semi-join reduction
BR
VRn
VRn
BR
VRi
VRi
BR
VR2
VR2
VR1
VR1
BR
BR
23Cost Model
- Metrics
- Reaction Time
- Resource Usage
- Cost in joules Wcpu CPU Wram RAM Wsend
NbMsgs Wbdw SizeMsgs - Wcpu 0.000001 J/instruction
- Wram 0
- Wsend 0.059 J/msg
- Wbdw 0.23 J/ Kbytes
24Some new Challenges
- Decentralized query execution/optimization
- A single site cannot maintain precise
meta-information about the complete system - Adaptative query processing
- Conditions in a device network change over time
- Devices fail, move or disconnect
25The Cornell COUGAR Project
- A first version of the Cougar system is
implemented on top of the WINS sensor network
infrastructure. - Demonstration at the Intel Computing Continuum
Conference - http//www.intel.com/intel/cccon
- Demonstration in the context of the DARPA Sensit
Program - http//www.darpa.mil/ito/research/sensit/