1 Acquisitional Query Processing in TinyDB Sam Madden UC Berkeley NEST Winter Retreat 2003.

Slides:



Advertisements
Similar presentations
Declarative sensor networks David Chu Computer Science Division EECS Department UC Berkeley DBLunch UC Berkeley 2 March 2007.
Advertisements

Trickle: Code Propagation and Maintenance Neil Patel UC Berkeley David Culler UC Berkeley Scott Shenker UC Berkeley ICSI Philip Levis UC Berkeley.
한국기술교육대학교 컴퓨터 공학 김홍연 TinyDB : An Acquisitional Query Processing System for Sensor Networks. - Samuel R. Madden, Michael J. Franklin, Joseph M. Hellerstein,
1 Sensor Network Databases Ref: Wireless sensor networks---An information processing approach Feng Zhao and Leonidas Guibas (chapter 6)
1 Querying Sensor Networks Sam Madden UC Berkeley.
PEDS September 18, 2006 Power Efficient System for Sensor Networks1 S. Coleri, A. Puri and P. Varaiya UC Berkeley Eighth IEEE International Symposium on.
1 Supporting Aggregate Queries Over Ad-Hoc Wireless Sensor Networks Samuel Madden UC Berkeley With Robert Szewczyk, Michael Franklin, and David Culler.
Distributed Regression: an Efficient Framework for Modeling Sensor Network Data Carlos Guestrin Peter Bodik Romain Thibaux Mark Paskin Samuel Madden.
Multi-dimensional Range Query in Sensor Networks Xin Li,Young Jim Kim, Ramesh Govindan (University of Southern California ) Wei Hong (Intel Research Lab.
Dissemination protocols for large sensor networks Fan Ye, Haiyun Luo, Songwu Lu and Lixia Zhang Department of Computer Science UCLA Chien Kang Wu.
Aggregation in Sensor Networks NEST Weekly Meeting Sam Madden Rob Szewczyk 10/4/01.
Sensor Database: Querying Sensor Networks Yinghua Wu, Haiyong Xie.
A Survey of Wireless Sensor Network Data Collection Schemes by Brett Wilson.
Approximate data collection in sensor networks the appeal of probabilistic models David Chu Amol Deshpande Joe Hellerstein Wei Hong ICDE 2006 Atlanta,
Probabilistic Data Aggregation Ling Huang, Ben Zhao, Anthony Joseph Sahara Retreat January, 2004.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong Presentation.
Wireless Distributed Sensor Networks Special Thanks to: Jasvinder Singh Hitesh Nama.
SIGMOD'061 Energy-Efficient Monitoring of Extreme Values in Sensor Networks Adam Silberstein Kamesh Munagala Jun Yang Duke University.
SWIM 1/9/20031 QoS in Data Stream Systems Rajeev Motwani Stanford University.
TAG: A TINY AGGREGATION SERVICE FOR AD-HOC SENSOR NETWORKS Presented by Akash Kapoor SAMUEL MADDEN, MICHAEL J. FRANKLIN, JOSEPH HELLERSTEIN, AND WEI HONG.
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Paper By : Samuel Madden, Michael J. Franklin, Joseph Hellerstein, and Wei Hong Instructor :
Query Driven Data Collection and Data Forwarding in Intermittently Connected Mobile Sensor Networks Wei WU 1, Hock Beng LIM 2, Kian-Lee TAN 1 1 National.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong.
TinyOS By Morgan Leider CS 411 with Mike Rowe with Mike Rowe.
Sensor Network Databases1 Overview: Chapter 6  Sensor Network Databases  Sensor networks are conceptually a distributed DB  Store collected data  Indexes.
Routing and Data Dissemination. Outline Motivation and Challenges Basic Idea of Three Routing and Data Dissemination schemes in Sensor Networks Some Thoughts.
March 6th, 2008Andrew Ofstad ECE 256, Spring 2008 TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden, Michael J. Franklin, Joseph.
1 Pradeep Kumar Gunda (Thanks to Jigar Doshi and Shivnath Babu for some slides) TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden,
TAG: a Tiny Aggregation Service for Ad-Hoc Sensor Networks Authors: Samuel Madden, Michael Franklin, Joseph Hellerstein Presented by: Vikas Motwani CSE.
1 TAG: A Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden UC Berkeley with Michael Franklin, Joseph Hellerstein, and Wei Hong December.
1 Querying Sensor Networks Sam Madden UC Berkeley December 13 th, New England Database Seminar.
INT 598 Data Management for Sensor Networks Silvia Nittel Spatial Information Science & Engineering University of Maine Fall 2006.
Sensor Database System Sultan Alhazmi
1 EnviroStore: A Cooperative Storage System for Disconnected Operation in Sensor Networks Liqian Luo, Chengdu Huang, Tarek Abdelzaher John Stankovic INFOCOM.
The Design of an Acquisitional Query Processor for Sensor Networks CS851 Presentation 2005 Presented by: Gang Zhou University of Virginia.
한국기술교육대학교 컴퓨터 공학 김홍연 Habitat Monitoring with Sensor Networks DKE.
Query Processing for Sensor Networks Yong Yao and Johannes Gehrke (Presentation: Anne Denton March 8, 2003)
Opportunities in High-Rate Wireless Sensor Networking Hari Balakrishnan MIT CSAIL
REED: Robust, Efficient Filtering and Event Detection in Sensor Networks Daniel Abadi, Samuel Madden, Wolfgang Lindner MIT United States VLDB 2005.
1 REED: Robust, Efficient Filtering and Event Detection in Sensor Networks Daniel Abadi, Samuel Madden, Wolfgang Lindner MIT United States VLDB 2005.
DATA AGGREGATION Siddhartha Sarkar Roll no: CSE-4 th Year-7 th semester Sensor Networks (CS 704D) Assignment.
1 Shape Segmentation and Applications in Sensor Networks Xianjin Xhu, Rik Sarkar, Jie Gao Department of CS, Stony Brook University INFOCOM 2007.
KAIS T Distributed cross-layer scheduling for In-network sensor query processing PERCOM (THU) Lee Cheol-Ki Network & Security Lab.
Evaluating Wireless Network Performance David P. Daugherty ITEC 650 Radford University March 23, 2006.
Programming Sensor Networks Andrew Chien CSE291 Spring 2003 May 6, 2003.
Aggregation and Secure Aggregation. Learning Objectives Understand why we need aggregation in WSNs Understand aggregation protocols in WSNs Understand.
Link Layer Support for Unified Radio Power Management in Wireless Sensor Networks IPSN 2007 Kevin Klues, Guoliang Xing and Chenyang Lu Database Lab.
W. Hong & S. Madden – Implementation and Research Issues in Query Processing for Wireless Sensor Networks, ICDE 2004.
In-Network Query Processing on Heterogeneous Hardware Martin Lukac*†, Harkirat Singh*, Mark Yarvis*, Nithya Ramanathan*† *Intel.
TreeCast: A Stateless Addressing and Routing Architecture for Sensor Networks Santashil PalChaudhuri, Shu Du, Ami K. Saha, and David B. Johnson Department.
REED : Robust, Efficient Filtering and Event Detection in Sensor Network Daniel J. Abadi, Samuel Madden, Wolfgang Lindner Proceedings of the 31st VLDB.
Aggregation and Secure Aggregation. [Aggre_1] Section 12 Why do we need Aggregation? Sensor networks – Event-based Systems Example Query: –What is the.
Sep Multiple Query Optimization for Wireless Sensor Networks Shili Xiang Hock Beng Lim Kian-Lee Tan (ICDE 2007) Presented by Shan Bai.
1 TAG: A Tiny Aggregation Service for Ad-Hoc Sensor Networks Samuel Madden UC Berkeley with Michael Franklin, Joseph Hellerstein, and Wei Hong December.
Lecture A/18-849B/95-811A/19-729A Internet-Scale Sensor Systems: Design and Policy Lecture 15 Sensor Databases & Data Stream Systems Phil Gibbons.
Building Wireless Efficient Sensor Networks with Low-Level Naming J. Heihmann, F.Silva, C. Intanagonwiwat, R.Govindan, D. Estrin, D. Ganesan Presentation.
The Design of an Acquisitional Query Processor For Sensor Networks Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, and Wei Hong Presentation.
1 Along & across algorithm for routing events and queries in wireless sensor networks Tat Wing Chim Department of Electrical and Electronic Engineering.
TAG: a Tiny AGgregation service for ad-hoc sensor networks Authors: Samuel Madden, Michael J. Franklin, Joseph M. Hellerstein, Wei Hong Presenter: Mingwei.
Demetrios Zeinalipour-Yazti (Univ. of Cyprus)
Introduction to Wireless Sensor Networks
Querying Sensor Networks
Distributed database approach,
The Design of an Acquisitional Query Processor For Sensor Networks
Trickle: Code Propagation and Maintenance
Querying Sensor Networks
Querying Sensor Networks
Streaming Sensor Data Fjord / Sensor Proxy Multiquery Eddy
REED : Robust, Efficient Filtering and Event Detection
Aggregation.
Presentation transcript:

1 Acquisitional Query Processing in TinyDB Sam Madden UC Berkeley NEST Winter Retreat 2003

2 Acquisitional Query Processing (ACQP) Cynical DB person question: what’s really different about sensor networks? –Low Power? –Lots of Nodes? –Limited Processing Capabilities? Laptops! Distributed DBs! Moore’s Law! Being a little bit facetious, but…

3 Answer Long running queries on physically embedded devices that control when and and with what frequency data is collected! Versus traditional systems where data is provided a priori Data collection aware query processing  “acqusitional query processing”, or ACQP!

4 ACQP: What’s Different? How does the user control acquisition? –Rates or lifetimes –Event-based triggers How should the query be processed? –Sampling as a first class operation –Events or joins Which nodes have relevant data? –Semantic Routing Tree »Nodes that are queried together route together Which samples should be transmitted? –Pick most “valuable”? Aggregate others? –Store results for later delivery? SIGMOD Submission! Language Features Execution Features

5 Outline TinyDB Acquisitional Language Features –Events –Buffers –Rates & Lifetimes Acquisitional Processing (a taste) –Optimization of selections –Buffering results »Choosing where to place storage ACQP

6 Outline TinyDB Acquisitional Language Features –Events –Buffers –Rates & Lifetimes Acquisitional Processing (a taste) –Optimization of selections –Buffering results »Choosing where to place storage ACQP

7 TinyDB/GSK Programming sensor nets is hard! Declarative queries are easy –TinyDB : In-network processing via declarative queries Example: »Vehicle tracking application Custom code –1-2 weeks to develop –Hundreds of lines of C TinyDB query (on right): –2 minutes to develop –Comparable functionality SELECT nodeid FROM sensors WHERE mag > thresh EPOCH DURATION 64ms

8 TinyDB Features A distributed query processor for networks of Mica motes –Available today! Goal: Eliminate the need to write C code for most TinyOS users Features –Declarative queries –Temporal + spatial operations –Multihop routing –In-network storage

9 A B C D F E TinyDB Execution Query {D,E,F} {B,D,E,F} {A,B,C,D,E,F} Written in SQL-Like Language With Extensions For : Sample rate Offline delivery Temporal Aggregation (Almost) All Queries are Continuous and Periodic

10 Declarative Queries for Sensor Networks Examples: SELECT nodeid, light FROM sensors WHERE light > 400 EPOCH DURATION 1s 1 EpochNodeidLightTempAccelSound 01455xxx 02389xxx 11422xxx 12405xxx Sensors

11 Aggregation Queries SELECT roomNo, AVG(sound) FROM sensors GROUP BY roomNo HAVING AVG(sound) > 200 EPOCH DURATION 10s Rooms w/ sound > SELECT AVG(sound) FROM sensors EPOCH DURATION 10s EpochAVG(sound) EpochroomNoAVG(sound)

12 TinyDB Screenshot

13 Outline TinyDB Acquisitional Language Features –Events –Buffers –Rates & Lifetimes Acquisitional Processing (a taste) –Optimization of selections –Buffering results »Choosing where to place storage ACQP

14 Event Based Processing ACQP – want to initiate queries in response to events ON EVENT bird-enter(…) SELECT b.cnt+1 FROM birds AS b OUTPUT INTO b ONCE In-network storage Subject to optimization CREATE BUFFER birds(uint16 cnt) SIZE 1

15 More Events ON EVENT bird_detect(loc) AS bd SELECT AVG(s.light), AVG(s.temp) FROM sensors AS s WHERE dist(bd.loc,s.loc) < 10m SAMPLE PERIOD 1s for 10 [Coming soon!]

16 Event Based Processing

17 Lifetime Queries Lifetime vs. sample rate SELECT … LIFETIME 30 days SELECT … LIFETIME 10 days MIN SAMPLE INTERVAL 1s Implies not all data is xmitted

18 (Single Node) Lifetime Prediction

19 Processing Lifetimes At root –Compute SAMPLE PERIOD that satisfies lifetime –If it exceeds MIN SAMPLE PERIOD (MSP), use MSP and compute transmission rate At other nodes – use root’s values or less Root = bottleneck –Multiple roots? –Adaptive roots?

20 In-network Buffers In-network storage needed for: –Offline delivery / high sample rates –Result correlation (joins) –Power conservation CREATE TABLE myLight SIZE 5 (id uint16, value uint16) SELECT nodeid,light INTO myLight SAMPLE PERIOD 100ms SELECT WINMAX(5,light) FROM myLight SAMPLE PERIOD 500ms

21 Outline TinyDB Acquisitional Language Features –Events –Buffers –Rates & Lifetimes Acquisitional Processing (a taste) –Optimization of selections –Buffering results »Choosing where to place storage ACQP

22 Declarative -> Optimizable Queries don’t specify: –Where operators run –Order in which operators run –What algorithm operators use –Duty cycles –Rates, in lifetime queries –Path along which data is routed … Easy to express, power-efficient, and fault-tolerant! –Through optimizations!

23 Operator Ordering: Interleave Sampling + Selection SELECT light, mag FROM sensors WHERE pred1(mag) AND pred2(light) SAMPLE INTERVAL 1s Energy cost of sampling mag >> cost of sampling light 1500 uJ vs. 90 uJ Correct ordering (unless pred1 is very selective): At 1 sample / sec, total power savings could be as much as 4mW, same as the processor! 2. Sample light Apply pred2 Sample mag Apply pred1 1. Sample light Sample mag Apply pred1 Apply pred2 3.Sample mag Apply pred1 Sample light Apply pred2

24 Optimizing in ACQP Sampling = “expensive predicate” Subtleties –Which predicate to “charge”? –Sampling must precede some operators Solution –Treat sampling as a separate task –Build a partial order –Use series-parallel scheduling algorithm to find best schedule »Monma & Sidney, 1979, as in Ibaraki & Kameda, TODS, 1984, or Hellerstein, TODS, 1998.

25 Exemplary Aggregate Pushdown SELECT WINMAX(light,8s,8s) FROM sensors WHERE mag > x SAMPLE INTERVAL 1s Unless > x is very selective, correct ordering is: Sample light Check if it’s the maximum If it is: Sample mag Check predicate If satisfied, update maximum

26 Event-Join Duality ON EVENT E(nodeid) SELECT a FROM sensors AS s WHERE s.nodeid = e.nodeid SAMPLE INTERVAL d FOR k Problem: multiple outstanding queries (lots of samples) t d d d/2 High event frequency → Use Rewrite Rewrite problem: phase alignment! Solution: subsample SELECT s.a FROM sensors AS s, events AS e WHERE s.nodeid = e.nodeid AND e.type = E AND s.time – e.time < k AND s.time > e.time SAMPLE INTERVAL d

27 Placing Buffers Buffer location not specified by query TinyDB chooses where storage lives –Current implementation: partition by nodeid –Other options »At root »At storage rich node »At a randomly selected node (for load balancing) –Open problems: »Finding storage »Choosing the best location »Making storage fault-tolerant?

28 Summary & Conclusions ACQP: Focus on acquisitional issues –Acquisitional Language Features: »Events »Lifetimes »Buffers –Declarative interface enables transparent acquisitional optimizations: »Order of selections »Events  Joins »Placement of buffers –Making TinyDB more efficient and robust than the average sensor network programmer!

29 Questions?

30 Attribute Driven Topology Selection Observation: internal queries often over local area* –Or some other subset of the network »E.g. regions with light value in [10,20] Idea: build topology for those queries based on values of range-selected attributes –For range queries –Relatively static trees »Maintenance Cost

31 Attribute Driven Query Propagation [1,10] [7,15] [20,40] SELECT … WHERE a > 5 AND a < 12 Precomputed intervals = Semantic Routing Tree (SRT)

32 Attribute Driven Parent Selection [1,10] [7,15] [20,40] [3,6] [3,6]  [1,10] = [3,6] [3,7]  [7,15] = ø [3,7]  [20,40] = ø Even without intervals, expect that sending to parent with closest value will help

33 Simulation Result

34 ACQP How does the user control acquisition? –Rates or lifetimes. –Event-based triggers How should the query be processed? –Sampling as an operator! –Events as joins Which nodes have relevant data? –Semantic Routing Tree »Nodes that are queried together route together Which samples should be transmitted? –Pick most “valuable”?

35 Adaptive Rate Control Adaptive = 2x Successful Xmissions

36 Delta Encoding Must pick most valuable data How? –Domain Dependent »E.g., largest, average, shape preserving, frequency preserving, most samples, etc. Simple idea for time-series: order biggest-change-first

37 Choosing Data To Send Score each item Send largest score –Out of order -> Priority Queue Discard / aggregate when full [1,2]

38 Choosing Data To Send [1,2]

39 Choosing Data To Send [2,6] [3,15] [4,1] [1,2] |2-6| = 4 |2-15| = 13 |2-4| = 2

40 Choosing Data To Send [2,6] [3,15] [4,1] [1,2] |2-6| = 4 |15-4| = 11

41 Choosing Data To Send [2,6] [3,15] [4,1] [1,2]

42 Choosing Data To Send [2,6] [3,15] [4,1] [1,2]

43 Delta + Adaptivity 8 element queue 4 motes transmitting different signals 8 samples /sec / mote

44 Aggregate Prioritization Insight: Shared channel enables nodes to hear neighbor values Suppress values that won’t affect aggregate –E.g., MAX –Applies to all exemplary, monotonic aggregates e.g. top/bottom N, MIN, MAX, etc.

45 Hypothesis Testing Insight: Guess from root can be used for suppression –E.g. ‘MIN < 50’ –Works for monotonic & exemplary aggregates »Also summary, if imprecision allowed How is hypothesis computed? –Blind or statistically informed guess –Observation over network subset

46 Simulation: Aggregate Prioritization Uniform Value Distribution Dense Packing Ideal Communication

47 ACQP Summary Lifetime & event based queries –User preferences for when data is acquired Optimizations for –Order of sampling –Events vs. joins Semantic Routing Tree –Query dissemination Runtime priortization –Adaptive rate control –Which samples to send

48 Fun Stuff Temporal aggregates Sophisticated, sensor network specific aggregates Delta compression, wavelets, etc.

49 Temporal Aggregates TAG was about “spatial” aggregates –Inter-node, at the same time Want to be able to aggregate across time as well Two types: –Windowed: AGG(size,slide,attr) –Decaying: AGG(comb_func, attr) –Demo! … R1 R2 R3 R4 R5 R6 … slide =2 size =4

50 Isobar Finding

51 Summary Declarative queries are the right interface for data collection in sensor nets! –Easier, faster, & more robust Acquisitional Query Processing –Framework for addresses many new issues that arise in sensor networks, e.g. »Order of sampling and selection »Languages, indices, approximations that give user control over which data enters the system TinyDB Release Available -